cancel
Showing results for 
Search instead for 
Did you mean: 

Help required in JDBC Stored Procedure

Former Member
0 Kudos

Hi All,

i have a requirement where i need to update the Database table using Stored Procedure from PI.

I have the receiver JDBC channel and have done the mapping.

The stored procedure has inputs of type NUMBER, VARCHAR2,DATE. in the message mapping i tried passing the same values in the type field, it throwed an error like UnSuppoted Format. Then i changed the type to integer for NUMBER and String for Varchar2 then also it is throwing an error like

+java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PUT_XXXXX' ORA-06550: line 1, column 7: PL/SQL: Statement ignored +

Can any please help with what type i need to send from PI to Stored procedure?

Also, there two out type fileds defined in the Stored procedure..which i didnt create in my PI structure. Do we need to create that fileds in our structure?

Please help me.

Thanks,

Hemanth.

Accepted Solutions (0)

Answers (2)

Answers (2)

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Hemanth Kumar,

I understand that you want to execute a stored procedure using JDBC receiver channel and looking at error message, you think there is an issue with type defined in Data Type.

Now you need to debug step by step.

Step 1:- In Interface Mapping Determination, do not refer to Operational Mapping (delete only OM from there, not the receiver Message Interface). By doing so, you are not call the OM (which refer to Graphical Mapping (MM refer to Data Type (which you think is wrong)). Note: As there is no OM, we need to send the exact payload required by receiver JDBC from Runtime Work Bench, for testing purpose.

Step 2:- In receiver JDBC channel, change u2018Message Protocolu2019 from u201CXML SQL Formatu201D to u201CNative SQL Stringu201D. By doing this, you can do testing very fast; receiver JDBC channel will take only String. And we need to send the exact String which is needed by JDBC Stored Procedure. [Link1|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm]

Step 3:- Now from RWB test the scenario. Payload should like this, please take help of Data base team to find the String which needs to send.

EXECUTE PUT_uspAddress @City = 'New York'

OR If you have access to the database, logon to it directly and try running the Stored Procedure.

Step 4:- Now, you should have the string which executes the Stored Procedure correctly to go ahead. Your job is 60% done.

Step 5:- Now, in receiver JDBC channel, change u2018Message Protocolu2019 from u201CNative SQL Stringu201D to u201CXML SQL Formatu201D. So that receiver JDBC channel will take only XML.

Step 6:- So now, you have to construct equalant XML structure to String you got in Step 4.

It may look like this [Link2|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b72b2fde93673e10000000a114a6b/frameset.htm]

<StatementName>
    <storedProcedureName action=u201D EXECUTEu201D>
       <table> PUT_uspAddress </table>
        < City [isInput=u201Dtrueu201D] type=SQLDatatype>val1</ City>
    </storedProcedureName > 
  </StatementName>

Step 7:- Now use the XML you have constructed in Step 6, to test the scenario from RWB. Try to correct if you come up with some errors. Your job is 90% done.

Step 8:- Now, in Interface Mapping Determination refer back the Operational Mapping again, which contain the Message Mapping. Make sure that Message Mapping give the XML output same as XML you have developed in Step 6.

FYI. 1. Whatever youu2019re sending, it will be converted to JDBC statement and will be executed on the database. logSQLStatement(JDBC Additional parameters sapnote_0000801367) will be show in logging not in payload.

2. Most of the cases, type defined in Data Type has no control of what we can send in that element (except Date type). Let say, you can define an element u2018Ageu2019 as u2018numberu2019, but you can always send u201Casdfasdfu201D as input in Message Mapping.

Regards,

Raghu_Vamsee

Former Member
0 Kudos

>

> Hi All,

>

> i have a requirement where i need to update the Database table using Stored Procedure from PI.

> I have the receiver JDBC channel and have done the mapping.

>

> The stored procedure has inputs of type NUMBER, VARCHAR2,DATE. in the message mapping i tried passing the same values in the type field, it throwed an error like UnSuppoted Format. Then i changed the type to integer for NUMBER and String for Varchar2 then also it is throwing an error like

>

> +java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PUT_XXXXX' ORA-06550: line 1, column 7: PL/SQL: Statement ignored +

>

> Can any please help with what type i need to send from PI to Stored procedure?

>

> Also, there two out type fileds defined in the Stored procedure..which i didnt create in my PI structure. Do we need to create that fileds in our structure?

>

> Please help me.

>

> Thanks,

> Hemanth.

Have you a log for Receiver Interface data that you send to StoredP?

Former Member
0 Kudos

Yes i have given the logSQLstatement as true in advance tab. but still i can see only the xml in the CC monitoring.

please help.

Thanks,

Hemanth