on 10-22-2008 5:48 AM
Hi all,
I want to know response structure of Oracle Stored procedure.
I am able to insert the records into a table using a Stored procedure. Now i wanted to return some parameters from it, like insert_count and update_count.
In SAP help Link on [document format of Receiver JDBC Adapter|http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm]
For Stored procedure types it says:
All return values are returned in an XML structure. The results within the stored procedure are returned either as a table or as the element <update_count>. This depends on the SQL statements executed within the stored procedure. The return parameters of a stored procedure are attached in a separate structure.
So how can i return update_count from stored procedure and make appropriate response structure. Kindly help
Hi ,
For Oracle database you can use out parameter in u r stored procedure e.g .
Create or Replace Procedure Dtable.update_flag ( COUNT OUT varchar , Var1 IN varchar2 ) .
And after you witer u r update query in store procedure you can assign update count to the out parameter using SQL%Rowcount. e.g.
COUNT := SQL%ROWCOUNT ;
When this procedure is callled it will send back the update count in the COUNT parameter.
Regards,
Ganesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ganesh,
Very helpful answer. I did exactly as you said.
My stored procedure is inserting records one-by-one. So my response is comping in this format while inserting 2 records
<?xml version="1.0" encoding="UTF-8"?>
+<ns0:MT_FileOutput xmlns:ns0="urn:JDBCScenario">
<row>
<insert_count>1</insert_count>
</row>
<row>
<insert_count>1</insert_count>
</row>
</ns0:MT_FileOutput>+
But i want this format
<row>
<insert_count>2</insert_count>
</row>
So can stored procedure handle this?
Regards
Hi Arpil Gupta,
chk the below link it will be helpfull
to get the response from the we need to use BPM
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.