View previous topic :: View next topic
|
Author |
Message |
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi,
We are writing DB2 Stored Procedures for the 1st time. The system in which the DB2 Stored Procedures are written will be in COBOL and the calling system is a .Net system and further it is an external application to my application.
Now my question is:
1. What all parameters do i need to fetch as input for my Stored Proc.
For e.g if i want information for Employee ID, then will Employee ID be the only input to the Stored Proc or there will be other parameters as well?
2. I know that we just have to declare and open the Stored Proc and not do a fetch on the Cursor. Now if i face some error in the Open of the SQL Statement, then will my SQL Error Message length be the same as in normal SQL Error Codes i.e SQLCA?
3. How do i display the Error Messages encountered? Through the normal "DISPLAY" statement of COBOL or is there something else? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
In addition, there are examples at the REDBOOKs site for stored procedures,
in COBOL, C, REXX, SQL Procedure Language, DDL, JCL,
the url for the additional material for z/OS Stored Procedures is
www.redbooks.ibm.com/redbooks/SG247083 |
|
Back to top |
|
|
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi Dino,
I am unable to open the FTP link. Meanwhile i am going through the whole PDF document.
Thanks!!! |
|
Back to top |
|
|
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi,
I went through the document -Through the Call and Beyond.
It was quite informative.
But i am still unable to find the answer to one of my question:
"If i am declaring my Stored Procedures in Cobol, then do the calling program which is in .Net have the same parameters definition as in the COBOL Stored Proc? If yes, then how do we pass the packed decimal variables?" |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Suggest yuo go through some already available DB2 Store Proc at your shop-- not necessarily the one one which belongs to your team.
Quote: |
1. What all parameters do i need to fetch as input for my Stored Proc. For e.g if i want information for Employee ID, then will Employee ID be the only input to the Stored Proc or there will be other parameters as well? |
This depends on your application requirement-- no way I can tell from here what is needed and what is not, probabley no one can.
Quote: |
I know that we just have to declare and open the Stored Proc |
, You don't do that, unless I misunderstood.
Quote: |
do a fetch on the Cursor. |
Yes the only and probably the best way-- you have to have cursors.
Quote: |
Now if i face some error in the Open of the SQL Statement, then will my SQL Error Message length be the same as in normal SQL Error Codes i.e SQLCA? |
Don't worry about this-- you are still using SQL, same rules will be applied.
Quote: |
3. How do i display the Error Messages encountered? Through the normal "DISPLAY" statement of COBOL or is there something else? |
ah..this is site specific question, though I'll try to put up a general interpretaion-- Error messages if they are related to front end such as, in your case, entered Employee ID is wrong-- this should be reflected on Front-end screen, there is no meaning of showing this error only in the SYSOUT. And this "error-message" become the "output from SP".
If there is some other error, say some SQL code -904 comes and you pop-up this mesage"SQL code -904" on front end screen-- this will give a technically correct but a vague information to the "user"-- better you display this SQL code in SYSOUT and on front end throw some "manager understandable ( ) message, such as "Execution is not successful because the call to database was not complted. Get in touch with “some” support."
Hope this helps . . . |
|
Back to top |
|
|
|