View previous topic :: View next topic
|
Author |
Message |
selvamsrinivasan85
New User
Joined: 09 Aug 2010 Posts: 33 Location: Chennai
|
|
|
|
Hi all,
I have coded a COBOL Stored procedure (DB2) program, for which I am facing 2 issues. I have went through the ibm knowledge center and did exactly the same.
1.Didn't coded Null variable as Out parameter in CREATE PROCEDURE (SP definition). All other IN and OUT parameters coded. Initially setting all the Null fields to true. Based on query result, I am setting Null variables to 0 and moving corresponding values to Out variables in COBOL SP. After running SP using IBM Rational tool, I am only able to see Null values in OUT parameters.
Link : www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/apsg/src/tpc/db2z_xmpcobolstoredproceduregeneralwithnulls.html
2. In that SP, I am selecting columns of more than 2 tables with Alias for identifcation. On Compiling, I am getting DSNH2061 W "STATEMENT REFERENCES COLUMN "A"."COLUMN_NAME" WHICH IS NOT DECLARED IN THE SPECIFIC TABLES. But the bind is successful.
While running in IBM Rational tool, Result sets are coming without column names of table. How to remove Alias and connect more than 2 tables. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Quote: |
Result sets are coming without column names of table. |
That is how it will be, why do you need column name here?
Quote: |
How to remove Alias and connect more than 2 tables. |
why remove for the same column appearing in both or multiple tables, you will get err? |
|
Back to top |
|
|
selvamsrinivasan85
New User
Joined: 09 Aug 2010 Posts: 33 Location: Chennai
|
|
|
|
Hi Rohit,
I am not facing any issue incase of native SP. I used to get column names in Result set.
I hope removing Alias will resolve this issue 2.
Want alias on where clause like below. Suggestions please.
Select Col1_tb1, Col2_tb1, Col1_tb2, Col2_tb2 from Table1 A, Table2 B where A.id = B.id;
Any suggestions on issue 1 will be grateful. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Is that what you lookingg for?
Code: |
Select Col1_tb1 as col1,
Col2_tb1 as col2,
Col1_tb2 as col3,
Col2_tb2 as col4
from Table1 A, Table2 B
where A.id = B.id; |
|
|
Back to top |
|
|
selvamsrinivasan85
New User
Joined: 09 Aug 2010 Posts: 33 Location: Chennai
|
|
|
|
Hi Rohit,
You gave me a clue. Thanks.
I think below will work fine. Will try and let you know.
Code: |
Select A.Col1_tb1 as col1,
A.Col2_tb1 as col2,
B.Col1_tb2 as col3,
C.Col2_tb2 as col4
from Table1 A, Table2 B
where A.id = B.id; |
Code'd by Rohit Umarjikar |
|
Back to top |
|
|
|