View previous topic :: View next topic
|
Author |
Message |
tomehta
New User
Joined: 18 Aug 2008 Posts: 98 Location: India
|
|
|
|
Hello
I am using the following code in my program. Please suggest whether it will work fine. I dont have option to run it in a mainframe so asking here..
cursor decclaration.:
EXEC SQL
DECLARE CRS-MIFIDTRADING CURSOR WITH HOLD FOR
SELECT *
FROM
TGOVMIFIDTRADING
WHERE
INSTRUMENTID = : WS-INSTRUMENTID
END-EXEC.
and fetching it in this way..
EXEC SQL
FETCH CRS-MIFIDTRADING
INTO :DCLTGOVMIFIDTRADING
END-EXEC
DCLTGOVMIFIDTRADING is the dclgen variable. (group variable)
Can I use the select * and the DCLGEN 01 level variable for fetching?
Regards
Rohit |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I don't know, don't have time to access my mainframe,
never used it since it is such a stupid thing to do.
But there is a 'button' at the top of this page: MANUALS.
you probably will find that a DB2 programmers guide or reference manual would have something to say about using * in the SELECT phrase for a CURSOR. |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
HI Rohit,
I will work fine but its always been advisable to use the column name instead of using select * and also while fetching you should use all the variable name in which you fetching the records.
Regards
Ketan varhade |
|
Back to top |
|
|
|