View previous topic :: View next topic
|
Author |
Message |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
I need to define a cursor as follows:
SELECT A.name,A.CDE,A.city FROM table A WHERE A.CDE = CODEX and City IN ( subquery)
Is it possible to declare cursor one time and pass the value using variable in the above query. Ex: In above example CODEX is my variable name. I want to retrieve records depending on values in above varible which keeps on changing in one program and rest query remains same.
Regards,
Krunal
|
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
From what I understand, the cursor for a value of a specific CODEX will return all rows that match. For another value of CODEX, you will need to close the cursor, change the CODEX value and then reopen the cursor. |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
ya i will have to reopen the cursor again..
But is it possible to pass the value using variable from working storage section. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
I may be off here, but don't you use a colon to denote a WS variable?
As in
SELECT A.name,A.CDE,A.city FROM table A WHERE A.CDE = :CODEX and City IN ( subquery)
where CODEX is defined in working storage.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But is it possible to pass the value using variable from working storage section. |
This is the normal way to provide run-time values to a query. . .
I must be missing something. . . |
|
Back to top |
|
|
|