View previous topic :: View next topic
|
Author |
Message |
palas_08 Currently Banned New User
Joined: 26 Feb 2007 Posts: 9 Location: kolkatta
|
|
|
|
hi ,
is it possible to declare two cursors in one declaration statements ?
i.e
exec sql
declare curser <curser name1> ,<cursername2>,<cursername3>
select * from table
end-exec
this declaration is true or wrong ?
thanks & regrads
palas |
|
Back to top |
|
|
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
I guess The program will not compile successfully.
Maybe you could just try it out?!!.
Dinesh. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Even if it would compile, why?
Not a good idea to name the "same" thing different names. |
|
Back to top |
|
|
vini_srcna
Active User
Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
Why compile though..? It should be at precompile.
You cannot do that because it violates the SYNTAX of DECLARE CURSOR.
In the above example you are not trying to declare two cursors. You are just trying to give 3 different names to the same SELECT statement.
The cursor name has to be unique. In embedded SQL there can only one VALID SQL statement between EXEC SQL & delimiter (could be END EXEC,; etc depending on the host language). Hope this helps..!! Thanks |
|
Back to top |
|
|
|