View previous topic :: View next topic
|
Author |
Message |
swathi41
New User
Joined: 09 Jun 2007 Posts: 3 Location: hyderabad
|
|
|
|
I want to know how we can use stored procedures in Easytrieve.
swathi |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please show some sample code where you want to use a "stored procedure".
When you have a new question, please start a new topic rather than posting a reply to an existing topic. |
|
Back to top |
|
|
swathi41
New User
Joined: 09 Jun 2007 Posts: 3 Location: hyderabad
|
|
|
|
I want to know how we can use(the syntax) stored procedures in Easytrieve.
swathi |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You have just re-posted your original question with "(the syntax)" added in the middle.
This still does not explain what you are asking.
What are you calling a "stored procedure"? Most often a stored procedure is used with database processing. Is your question related to db2 or some other database system?
Once we understand your request, we may be able to make suggestions. |
|
Back to top |
|
|
swathi41
New User
Joined: 09 Jun 2007 Posts: 3 Location: hyderabad
|
|
|
|
Hi,
These are the COBOL Procedure for recieving values from SP:
*****************************************************
A stored procedure can return results sets back to your COBOL program by leaving the cursor open. The open cursor can then be accessed in the COBOL program after the stored procedure has been executed. At a high level, there are seven basic steps for receiving result sets:
1) Declare a locator variable for each result set that will be returned.
2) Call the stored procedure and check the SQL return code. If the SQLCODE from the CALL statement is +466, the stored procedure has returned result sets.
3) Determine how many result sets the stored procedure is returning. Use the SQL statement DESCRIBE PROCEDURE to determine the number of result sets. DESCRIBE PROCEDURE places information about the result sets in an SQLDA.
4) Link result set locators to result sets. You can use the SQL statement ASSOCIATE LOCATORS to link result set locators to result sets. The ASSOCIATE LOCATORS statement assigns values to the result set locator variables. If you specify more locators than the number of result sets returned, DB2 ignores the extra locators.
5) Allocate cursors for fetching rows from the result sets. Use the SQL statement ALLOCATE CURSOR to link each result set with a cursor. Execute one ALLOCATE CURSOR statement for each result set. The cursor names can be different from the cursor names in the stored procedure.
6) Determine the contents of the result sets. Use the SQL statement DESCRIBE CURSOR to determine the format of a result set and put this information in an SQLDA. For each result set, you need an SQLDA big enough to hold descriptions of all columns in the result set.
7) Fetch rows from the result sets into host variables by using the cursors that you allocated with the ALLOCATE CURSOR statements. Fetching rows from a result set is the same as fetching rows from a table.
In a Simliar way how can we use the locator in the Ezt plus and the wht is the syntax for the Stored procedure.
Thanks,
Swathi. |
|
Back to top |
|
|
|