Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 4 of 4 total |
Using EXISTS function as a condition in a WHILE loop |
Tue, May 18 2010 12:34 AM | Permanent Link |
Richard Harding Wise Nutrition Coaching | Is it possible to construct WHILE loop that uses an EXISTS function as the condition? Something like - - -
WHILE EXISTS (SELECT * FROM table1 WHERE X = 0) DO <stuff> END WHILE; At present I am doing the following: OPEN tmpCursor; SET I = ROWCOUNT(tmpCursor); CLOSE tmpCursor; WHILE I > 0 DO <stuff> OPEN tmpCursor; SET I = ROWCOUNT(tmpCursor); CLOSE tmpCursor; END WHILE; which is not very elegant. Richard Harding |
Tue, May 18 2010 4:02 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Richard,
<< Is it possible to construct WHILE loop that uses an EXISTS function as the condition? Something like - - - >> EXISTS can only be used in an SQL statement and cannot be used directly in SQL/PSM. You can find the new installation here: http://www.elevatesoft.com/203b13edbdaccs.exe Please let me know when you have downloaded it. << At present I am doing the following: >> This should be a bit cleaner: OPEN tmpCursor; WHILE ROWCOUNT(tmpCursor) > 0 DO <stuff> REFRESH tmpCursor; END WHILE; CLOSE tmpCursor; http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=REFRESH -- Tim Young Elevate Software www.elevatesoft.com |
Wed, May 19 2010 5:06 AM | Permanent Link |
Richard Harding Wise Nutrition Coaching | Thanks Tim. Your code was a much neater way of doing the same thing.
<<You can find the new installation here: http://www.elevatesoft.com/203b13edbdaccs.exe Please let me know when you have downloaded it.>> I downloaded the 2.03 b13 DAC-CS installation but I am not sure why I need it. Richard Harding |
Wed, May 19 2010 6:54 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Richard,
<< I downloaded the 2.03 b13 DAC-CS installation but I am not sure why I need it. >> Never mind that - it was for someone else and can be ignored. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |