View previous topic :: View next topic
|
Author |
Message |
rsm_deepak
New User
Joined: 06 Apr 2005 Posts: 30 Location: visakhapatnam
|
|
|
|
If the table consists of more fields can we give
EXEC SQL
DECLARE cursor-name CURSOR FOR
SELECT *
FROM table-name
WHERE search-condition
END-EXEC. |
|
Back to top |
|
|
cmbb
New User
Joined: 01 Feb 2006 Posts: 4
|
|
|
|
You can use it. When you fetch this cursor, you must read into the level 01 of the copy with the host variable.
This solution has some problems like, when you change the table, adding or removing fields, you must change the copy and recompile the program. |
|
Back to top |
|
|
twissi
Active User
Joined: 01 Aug 2005 Posts: 105 Location: Somerset, NJ
|
|
|
|
Quote: |
If the table consists of more fields can we give |
What do you mean by this? Tables use to have many fields !!
Or did you mean, if the SELECT query returns more rows (than one), can the CURSOR be used?
Yes you can, and that's what CURSORs are meant for! And your program should have a loop to process/handle all rows returned by the CURSOR.
Cheers, Twissi. |
|
Back to top |
|
|
|