Thread View: borland.public.interbase.sql
3 messages
3 total messages
Started by Jose Carlos
Tue, 26 Nov 2002 14:39
Getting out of a For Select
Author: Jose Carlos
Date: Tue, 26 Nov 2002 14:39
Date: Tue, 26 Nov 2002 14:39
12 lines
1291 bytes
1291 bytes
Hi all, I have a select in a stored procedure that can return multiple records but I only need to get the first one. How can I do it ? I haven't found a way to get out of a "for select" and continue executing mystored procedure. I cannot use a group y clause nor functions like min, max. I am using Interbase 6.0.2 with Win2k. Thanks for reading. Juliano
Re: Getting out of a For Select
Author: Bojidar Alexandrov
Date: Tue, 26 Nov 2002 14:02
Date: Tue, 26 Nov 2002 14:02
22 lines
1548 bytes
1548 bytes
Jose Carlos wrote: > Hi all, > > I have a select in a stored procedure that can return multiple > records but I only need to get the first one. How can I do it ? > I haven't found a way to get out of a "for select" and continue > executing mystored procedure. I cannot use a group y clause nor > functions like min, max. > I am using Interbase 6.0.2 with Win2k. > > Thanks for reading. > > Juliano There is break but don't use it. Try with wile loop instead or separate sp with exit after the first suspend -- Bojidar Alexanrov Kodar Ltd. http://www.Kodar.net
Re: Getting out of a For Select
Author: G. Allen Casteran
Date: Tue, 03 Dec 2002 23:28
Date: Tue, 03 Dec 2002 23:28
22 lines
1645 bytes
1645 bytes
Either Change your SQL to ONLY return 1 row, or in your loop set a flag when you are done and check the flag value at the loop start to see if you need to do the processing portion. You will still be scanning over the records in the result set, though. Allen. In article <3de379e0@newsgroups.borland.com>, jcmarcussojr@hotmail.com says... > Hi all, > > I have a select in a stored procedure that can return multiple records > but I only need to get the first one. How can I do it ? > I haven't found a way to get out of a "for select" and continue executing > mystored procedure. I cannot use a group y clause nor functions like min, > max. > I am using Interbase 6.0.2 with Win2k. > > Thanks for reading. > > Juliano
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads