View previous topic :: View next topic
|
Author |
Message |
aq16
New User
Joined: 04 Mar 2006 Posts: 3
|
|
|
|
Hi All,
I have a COBOL+DB2 batch program having a SQL SELECT statement with 'WHERE' clause on Primary key.
I pass the primary key into host variable before EXEC SQL SELECT statement , after returning from DB2 the SQLCODE is 0 but the sleected column host variables are not getting populated.
What may be the problem?
Thanks in advance,
Shishir |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
How about posting the select and the host variables? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
In addition to posting the requested code, what happens if you run this query in spufi? |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
You failure to follow up the request for the actual SQL you intend to execute may indicate that you have found the solution, but anyway:
A common mistake made by programmers is that they expect values for host variables used in the where statement to be updated with the actual value for a fetched row.
You should include the wanted column in the select into a host variable to get the actual value. |
|
Back to top |
|
|
|