View previous topic :: View next topic
|
Author |
Message |
nag Warnings : 1 New User
Joined: 29 Jul 2005 Posts: 20
|
|
|
|
This is the Question that i have faced in my Interview.
There is an SQL query which contains Hardcoded values in the Where clause.
There are no date fields or time fields in the where caluse.
If we execute this query in the Cobol-DB2 program its giving SQLCODE=100 but if
we execute the same Query in SPUFI it is giving the valid records.
What might be the reason behind this? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Is it possible that you have mis-quoted the interview questoin?
Something that often gets confused is that SPUFI returns 100 as a normal completion. |
|
Back to top |
|
|
nag Warnings : 1 New User
Joined: 29 Jul 2005 Posts: 20
|
|
|
|
dick scherrer wrote: |
Hello,
Is it possible that you have mis-quoted the interview questoin?
Something that often gets confused is that SPUFI returns 100 as a normal completion. |
No i told him that if the cond in Where clause is not staisfied then it will return NULL in SPUFI. He said no its returning records in SPUFI but not in program. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
the query might be handling NULLS in the program and the resultant rows are having NULLS. in that case, you will get results in SPUFI and not in program. |
|
Back to top |
|
|
nag Warnings : 1 New User
Joined: 29 Jul 2005 Posts: 20
|
|
|
|
the_gautam wrote: |
the query might be handling NULLS in the program and the resultant rows are having NULLS. in that case, you will get results in SPUFI and not in program. |
If we are handling NULLS in the program then we move proper value by checking the NUll Indicator.
He told that we are getting proper records in the SPUFI not NULL.
I think this mite be the reason.
While binding the jcl we will specify the Qualifier and in the SPUFI if we do do specify the same qualifier then it will refer diff database and then i think there are chances of getting data here.I am not sure of that. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
If we execute this query in the Cobol-DB2 program its giving SQLCODE=100 but if |
spufi is getting a 100 sqlcode behind the scenes...
for any programming language used ( as a general point )
when using a cursor to fetch rows the program will keep getting a 0 sqlcode for each row fetched
a 100 sqlcode when there are no more rows to fetch
I guess that there was a communication problem at that table
on when the 100 sqlcode comes out |
|
Back to top |
|
|
|