on 12-02-2009 9:41 AM
Hi All,
I am facing problem while executing Stored Procedures using sender and receiver sides of JDBC adapter.
Here is my SP in Oracle DB :
PROCEDURE EMP
( ID IN VARCHAR2,NAME IN VARCHAR2,PROCESSED IN VARCHAR2 ) AS
BEGIN
INSERT INTO EMPLOYEE VALUES (ID, NAME, PROCESSED);COMMIT;END EMP;
Now I want to execute this SP using sender JDBC channel and receiver JDBC channel.
Can anyone please help me executing this SP?
Regards,
Soorya
HI Please find some reference Link
For this you can refer this link on how to create a DT for Executing a stored procedure:
http://help.sap.com/saphelp_nw70/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Check it out..
For more info on StoredProcedure:
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
Thanks,
Bhupesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Soorya,
If you are planning to execute this SP through JDBC sender adapter then it might not be successful as it is not returning anything to PI
PROCEDURE EMP
( ID IN VARCHAR2,NAME IN VARCHAR2,PROCESSED IN VARCHAR2 ) AS
BEGIN
INSERT INTO EMPLOYEE VALUES (ID, NAME, PROCESSED);COMMIT;END EMP;
This SP code will work for Receiver JDBC and not for sender
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Soorya,
The receiver Data type should be like this:
<StatementName>
<storedProcedureName action=u201D EXECUTEu201D>
<table>realStoredProcedureeName</table>
<param1 [isInput=u201Dtrueu201D] [isOutput=true] type=SQLDatatype>val1</param1>
</storedProcedureName >
</StatementName>
Check the link http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
Which DB are you using?? The sender structure will be like
<resultset>
<row>
<field1></field1>
<field2></field2>
<field3></ field3>
</row>
</resultset>
Search SDN you will get lot of examples
Regards
Suraj
Hi Suraj,
I have created the input file like this :
<root>
<statement>
<EMPLOYEE action="EXECUTE">
<ID type="Varchar2">123</ID>
<NAME type="Varchar2">ABC</NAME>
<PROCESSED type="Varchar2">NO</PROCESSED>
</EMPLOYEE>
</statement>
</root>
I am using Oracle DB.
I have already shown the SP.
Please help in this case. Its very critical.
Regards,
Soorya
Hi Soorya,
Are you trying to insert this employee into DB?? Your target structure should look like this
<StatementName>
<storedProcedureName action=u201D EXECUTEu201D>
<table>EMP</table>
<ID isInput=u201Dtrueu201D type=VARCHAR2>val1</ID>
<NAME isInput=u201Dtrueu201D type=VARCHAR2>val1</NAME>
<PROCESSED isInput=u201Dtrueu201D type=VARCHAR2>val1</PROCESSED>
</storedProcedureName >
</StatementName>
Regards
Suraj
Hi Soorya,
Did you checked the note??? IT is having an example for sender Stored Procedure see how it is created...
Likewise create a one for you.. You cannot insert an employee using sedner JDBC adapter.. YEs you can try fetching the details of the inserted employee...
Take help of SP from the note..
Regards
Suraj
Hi Suraj,
Sorry to confuse you.
I have created one more SP as,
create or replace PROCEDURE SAPXI
(PROCESSED IN VARCHAR2 ) AS
BEGIN
SELECT * FROM EMPLOYEE WHERE PROCESSED ='NO';
UPDATE EMPLOYEE SET PROCESSED='YES' WHERE PROCESSED='NO';
COMMIT;
END SAPXI;
/
Now please help me executing this SP.
Regards,
Soorya
Hi Soorya,
create or replace PROCEDURE SAPXI
(PROCESSED IN VARCHAR2 ) AS
BEGIN
SELECT * FROM EMPLOYEE WHERE PROCESSED ='NO';
UPDATE EMPLOYEE SET PROCESSED='YES' WHERE PROCESSED='NO';
COMMIT;
END SAPXI;
Have you tested the above stored procedure in oracle DB? IS it returning something?, Say it returns A, B, C fields then your source Data type should be
<resultset>
<row>
<A>column-value</A>
<B>column-value</B>
<C>column-value</C>
</row>
<resultset>
Your select query in sender adapter will be will
select * from SAPXI;
Update query will be <TEST>
Try this
Regards
Suraj
Refer for JDBC receiver with stored procedure
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.