> >It's been my experience that if I have a stored procedure which returns > >rows in a particular order and perform a SELECT on this procedure, the > >row order of the SELECT matches that of the procedure. E.g.: > > > >What I would like to know, is this behavior documented or is it just a > >random occurence? I know that when SELECTing from tables/views I should > >always use ORDER BY if I need the records sorted in a particular order, > >but is the same thing true for selecting from stored procedures? > > Rows are returned in the exact order they are sent, i.e., the first > SUSPEND sends the first row to the buffer, the second SUSPEND sends the > second row, and so on.
*Returned* is obvious. But if I *read* these returned rows and output them again, is it a documented behavior that the output will reflect the ordering from the stored procedure? > It is much more efficient to have your SSP work with an ordered set, as > the FOR SELECT inside the SP can use indexes. Ordering the set of > virtual output is a sloooooow process and of course there are no indexes > to call on. Of course. But that's not the issue here. The issue is, if my procedure returns a growing sequence, can I depend on it always being growing or should I make sure by an explicit order outside of the procedure? Thanks, Pepa ------------------------------------ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: firebird-support-dig...@yahoogroups.com firebird-support-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: firebird-support-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/