Subject | Re: [ib-support] declare cursor |
---|---|
Author | Helen Borrie |
Post date | 2001-04-19T13:39:23Z |
At 03:24 PM 19-04-01 +0200, Jordi wrote:
DECLARE Mycursor CURSOR FOR...ETC. ought to work.
Tip: unless you have some especial reason to use a cursor (e.g. you are writing embedded SQL), don't. In a stored procedure that has to iterate through a set, a FOR SELECT...INTO...DO construction is recommended.
If your purpose is to get an output set from a SP using a cursor to populate a temporary table or disk file for client use, STOP THERE. This is not MSSQL Server. :) In IB, you can use the FOR..SELECT...INTO...DO...SUSPEND construct to build a dataset, which your client application then gets with a SELECT statement.
Cheers,
Helen
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Hi!Perhaps you have the cursor name in the wrong position; and "cursor" is a reserved token.
>
>how can I create a cursor? the documentation talks about something like:
>
>DECLARE cursor CURSOR FOR <select> [FOR UPDATE OF <col> [, <col>.]];
>
>available in SQL, but this doesn't works, it gives me an invalid token error
>just in the cursor name
DECLARE Mycursor CURSOR FOR...ETC. ought to work.
Tip: unless you have some especial reason to use a cursor (e.g. you are writing embedded SQL), don't. In a stored procedure that has to iterate through a set, a FOR SELECT...INTO...DO construction is recommended.
If your purpose is to get an output set from a SP using a cursor to populate a temporary table or disk file for client use, STOP THERE. This is not MSSQL Server. :) In IB, you can use the FOR..SELECT...INTO...DO...SUSPEND construct to build a dataset, which your client application then gets with a SELECT statement.
Cheers,
Helen
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________