Error calling a  stored procedure returning a PLSQL table /  REF cursor

stored proceure declares -
TYPE A_rec IS RECORD (
date DATE,
id NUMBER(10),
start NUMBER (10),
end NUMBER (10)
TYPE tmp_tbl IS TABLE OF A_rec ;
PROCEDURE get_B(
p_id IN NUMBER,
p_startdate IN DATE,
p_enddate IN DATE,
p_tbl OUT tmp_tbl
My Java code reads -
StoredProcedureCall storedProcedureCall = new StoredProcedureCall();
storedProcedureCall.setProcedureName("get_B");
DataReadQuery query = new DataReadQuery();
query.setCall(storedProcedureCall);
Vector parameters = new Vector();
/** For all input params **/
query.addArgument(param.getInputParamName(" name");
parameters.add("values");
/** Now comes the OUT part .. i am not sure what to do **/
storedProcedureCall.useNamedCursorOutputAsResultSet("p_tbl ");
/** execute query **/
Vector result = (Vector) getSession(ctx).executeQuery(query, parameters);
------------- My program does not throw any error ... but does not return anything ----

TopLink currently doesn't support pl/sql types to be used as stored procedures parameters - but version 11 will.
However you can use a single cursor as an out parameter in your stored procedure:
p_tbl OUT CURSOR_TYPE.ANY_CURSOR,
and it will be returned by TopLink.

Similar Messages

  • Error calling a stored procedure from C#

    Please help me!
    I'm new in .net technology.
    I have an Oracle 9i server and an application in .net C# language.
    I'm trying to call a stored procedure written in plsql.
    This is the testing procedure:
    CREATE OR REPLACE PROCEDURE TEST_PROC
    par_1 in number
    as
    begin
    insert into tbltestinput (number_col) values (par_1);
    commit;
    end;
    And the calling code is:
    OracleCommand objCmd = new OracleCommand("TEST_PROC",conn);
    objCmd.CommandType = CommandType.StoredProcedure;
    OracleParameter inPar_1 = new OracleParameter();
    inPar_1.OracleType = OracleType.Number;
    inPar_1.Direction = ParameterDirection.Input;
    inPar_1.Value = 123456;
    objCmd.Parameters.Add(inPar_1);
    objCmd.ExecuteNonQuery();
    It returns this error:
    Exception Message: ORA-06550: row 1, column 7: PLS-00306: wrong number or types of arguments in call to 'TEST_PROC' ORA-06550: row 1, column 7: PL/SQL: Statement ignored
    Exception Source: System.Data.OracleClient
    The stored procedure is very very simple to test only the call.
    Anybody can help me.
    Thanks !!!!

    Hello,
    System.Data.OracleClient == Microsoft provider for Oracle (whereas this is the Oracle Data Provider for .NET forum).
    However, the MS provider operates in Bind By Name mode, so you might try adding this to your code:
    inPar_1.ParameterName = "par_1";Perhaps that will help a bit,
    Mark

  • Error calling Java Stored Procedure

    hi I am calling java stored procedure from jdbc. i am getting wierd exceptions:
    CallableStatement cstmt = conn.prepareCall("begin SEND_MAIL(?,?,?);end;");
    cstmt.setString(1,"[email protected]");
    cstmt.setString(2,"Mail from Stored Proc");
    cstmt.setString(3,"This is test mail from Oracle8i");
    cstmt.execute();
    i am getting following Exception:
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.util.PropertyPermission * read,write) has not been granted by dbms_java.grant_permission to SchemaProtectionDomain(ISTORE_CUST|PolicyTableProxy(ISTORE_CUST))
    ORA-06512: at "ISTORE_CUST.SEND_MAIL", line 0
    ORA-06512: at line 1
    null

    I think u dont've previleges to run
    the procedure.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by arunr12:
    hi I am calling java stored procedure from jdbc. i am getting wierd exceptions:
    CallableStatement cstmt = conn.prepareCall("begin SEND_MAIL(?,?,?);end;");
    cstmt.setString(1,"[email protected]");
    cstmt.setString(2,"Mail from Stored Proc");
    cstmt.setString(3,"This is test mail from Oracle8i");
    cstmt.execute();
    i am getting following Exception:
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.util.PropertyPermission * read,write) has not been granted by dbms_java.grant_permission to SchemaProtectionDomain(ISTORE_CUST|PolicyTableProxy(ISTORE_CUST))
    ORA-06512: at "ISTORE_CUST.SEND_MAIL", line 0
    ORA-06512: at line 1
    <HR></BLOCKQUOTE>
    null

  • Error Calling Oracle Stored Procedure From Within Report

    Hi,
    I have a report that calls an oracle stored procedure which returns a ref cursor. The report is working ok in our development environment when called from our development website through .NET.
    When the report is moved and accessed from our UAT website we get the following error :-
    Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for Oracle Description: One or more errors occurred during processing of command. Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for Oracle Description: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'RHS_GET_CAND_SECTION_REFS' ORA-06550: line 1, column 7: PL/SQL: Statement ignored Native Error: Failed to open a rowset. Error in File C:\WINDOWS\TEMP\temp_d663a952-bef6-4bf7-bf1a-5e288afdb612 {9B6DFB38-A436-4940-9D80-B4C23DFFFF19}.rpt: Failed to open a rowset.
    If we open the report manually we are prompted to enter database connection info. If we enter the UAT connection details the report runs ok. If we save the report and try to open it from UAT website through .NET it now opens ok.
    If we then move that same report back to the development environment and open from our development website it fails with the same error above.
    Both connections are using Microsoft OLE DB drivers and the Oracle databases are the same version (10.2.0.1.0).
    Is the connection information being stored in actual report and somehow being used when the report is opened through .NET?
    Any help appreciated
    Regards
    Paul

    Hi,
    Please let me know if the issue occurs with the crystal reports designer, if you are facing issues with the .NET application then a need to create a post [here|SAP Crystal Reports, version for Visual Studio;.
    Regards,
    Hitesh

  • Calling Write Stored procedure from xsodata with table/list as input

    I have a stored procedure which takes table type as input and insert data in a table
    PROCEDURE "C"."abcd.procedures::InsertResData" ( IN  resourcelist "abcd.procedures.ResourceT",out error "abcd.data:abcd.procedures.tt_error"  )
      LANGUAGE SQLSCRIPT
      SQL SECURITY INVOKER abc
      --DEFAULT SCHEMA <default_schema_name>
      AS
    BEGIN
    ---some insert logic-
    END
    Now I have exposed the SP using XSODATA so that UI can consume it.
    service namespace "abcd.hana.service"{
    "abcd.views/Resourceview.attributeview" as "resourceitem"
    key("RESOURCE_ID")
    create using "abcd.procedures::InsertResData";
    Question: How can I pass array of input records to XSODATA. from UI? Is it supported?
    I could test with single record (JSON input) but could not test with multiple records
    Please help me on this if you have some expert opinion
    Regards,
    Apoorv

    I have a stored procedure which takes table type as input and insert data in a table
    PROCEDURE "C"."abcd.procedures::InsertResData" ( IN  resourcelist "abcd.procedures.ResourceT",out error "abcd.data:abcd.procedures.tt_error"  )
      LANGUAGE SQLSCRIPT
      SQL SECURITY INVOKER abc
      --DEFAULT SCHEMA <default_schema_name>
      AS
    BEGIN
    ---some insert logic-
    END
    Now I have exposed the SP using XSODATA so that UI can consume it.
    service namespace "abcd.hana.service"{
    "abcd.views/Resourceview.attributeview" as "resourceitem"
    key("RESOURCE_ID")
    create using "abcd.procedures::InsertResData";
    Question: How can I pass array of input records to XSODATA. from UI? Is it supported?
    I could test with single record (JSON input) but could not test with multiple records
    Please help me on this if you have some expert opinion
    Regards,
    Apoorv

  • Error calling a stored procedure

    Hi buddies, I've the following store procedure:
    PROCEDURE USP_GET_SMALL_SIZE_ROWS_DATA(tableName VARCHAR2, isSource pls_integer, since pls_integer, untilValue pls_integer, pk_Name OUT CLOB, xmlResult OUT CLOB);Inside the package REPLICATION_PACK
    and then, when I run this:
    DECLARE
      pk_Name CLOB;
      xmlResult CLOB;
    BEGIN
      EXEC REPLICATION_PACK.USP_GET_SMALL_SIZE_ROWS_DATA('TableName', 1, 1, 50, :pk_Name, :xmlResult);
    END;It shows me this error: "SP2-0552: Bind variable "XMLRESULT" not declared." Could you help me?
    Thanks you in advance.

    You can not do what it appears you are trying to do.
    EXEC REPLICATION_PACK.USP_GET_SMALL_SIZE_ROWS_DATA('PERSON', 1, 1, 50, pk_Name, xmlResult);
    requires that pk_Name and xmlResult have values: They have none. This is not code that can ever be run in SQL*Plus from the command line.
    Your procedures is built on the following parameters:
    (tableName VARCHAR2, isSource pls_integer, since pls_integer, untilValue pls_integer, pk_Name OUT CLOB, xmlResult OUT CLOB)So your table_name is 'PERSON' ... good so far
    You r isSource and since and untilVal are integers and your have provided 1, 1 and 50 ... good so far.
    But the next two parameters are OUT params ... they need to go somewhere.
    So run it like this:
    DECLARE
    pkNameOUT CLOB;
    xmlResultOUT CLOB;
    BEGIN
      REPLICATION_PACK.USP_GET_SMALL_SIZE_ROWS_DATA('PERSON', 1, 1, 50, pkNameOut, xmlResultOut);
    END;
    /Then you've got to figure out what to do with those two CLOB variables or they just evaporate.

  • Calling a stored procedure from within a ViewObject

    Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
    select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
    If not, is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
    In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
    We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.

    Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
    select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
    Yes. Using our expert-mode query feature this is possible.
    is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
    Yes. See this article about basing a view object on a REF CURSOR:
    http://radio.weblogs.com/0118231/2003/03/03.html
    In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
    No. Not directly. What's the business requirement here so I can understand better?
    We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.
    REF CURSOR would work fine, or if it's just the statement that needs to be generated dynamically, you could fetch the text of the SQL statement from the stored procedure, then use createViewObjectFromQueryStmt(). Although this has runtime overhead involved with describing the query.
    The REF CURSOR based approach is probably best for this.

  • How to call a stored procedure that has Table Of data types in VB6?

    Hi everyone,
    I need to call a stored procedure that has a Table Of data type as an input parameter (possibly even several Table Of input parameters). I can't seem to find any example of how to do this in VB6 using ODBC. Is this even possible?
    Thanks you!
    Steve

    Thanks,
    but I need to test stored procedures that uses type defined in the package.
    e.g.
    if I have s.p.
    PROCEDURE get_risultati_squadra
    ( in_squadra IN VARCHAR2,
    out_serie OUT tab_varchar2_5,
    out_tiporisultato OUT tab_varchar2_5,
    out_n_giornata OUT tab_varchar2_5,
    out_squadre OUT tab_varchar2_200,
    out_risultato OUT tab_varchar2_10,
    out_marcatore OUT tab_varchar2_50,
    out_punti OUT tab_varchar2_3,
    out_rimbalzista OUT tab_varchar2_50,
    out_rimbalzi OUT tab_varchar2_3,
    out_esito OUT tab_varchar2_2);
    I have to define every type external to the package, in this case five new TYPE !!
    Is there another way to solve this problem?
    Thanks

  • JCA DB Adaptor to call a Stored Proc that updates a table

    Dear guru,
    I've a created JCA Db adaptor that will be used by OSB 10.3.1 that ultimately will call a stored procedure to update a table. However, I encountered exception :
    ORA-02089 COMMIT is not allowed in a subordinate session
    CREATE or REPLACE PROCEDURE EXAMPLEA
    StringA IN VARCHAR2,
    AS
    BEGIN
    UPDATE TABLE_A
    SET COLUMN_1 = 'testing'
    WHERE STRINGA_COLUMN = StringA ;
    COMMIT;
    END;
    If I removed the commit above, then I got another error :-
    JCA-11811
    Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the EXAMPLE_A. Cause: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: Transaction rolled back: Transaction timed out after 31 seconds
    Desperate help is needed. Thanks!

    The stored procedure adapter service will execute within a JTA transaction that will be committed so you must not explicitly execute a commit as part of your procedure code. When setting up a connection-instance in weblogic-ra.xml, you must provide one of either xADataSourceName or dataSourceName, but not both. If you use xADataSourceName then make sure that the JTA XA Connection check box is checked when you create your database connection and specify a JNDI name. Uncheck the box if you use dataSourceName.

  • Error in calling Stored procedure returns REFCURSOR

    Hi,
    I've written a oracle stored procedure returning REFCURSOR. say,extractorderdespatchconfirmsp('','','','','','H1','ACG','','','','',:rc).
    Following statement throwing error.
    CallableStatement cs = con.PrepareCall("{extractorderdespatchconfirmsp('','','','','','H1','ACG','','','','',:rc)}");
    rs = cs.executeQuery();
    Could you rectify this problem and give me the currect code.
    riyaz

    Your naming convention leaves a little to be desired.
    String command = "{CALL extractorderdespatchconfirmsp(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
    CallableStatement cstmt = conn.prepareCall(command);
    //set the variables here ie, dates need to be a timestamp format. use set timestamp.
    cstmt.setInt(1, 2);
    cstmt.setString(2, "a string");
    cstmt.setInt(3, 0);
    //for return values
    cstmt.registerOutParameter(3, Types.INTEGER);
    cstmt.registerOutParameter(2, Types.INTEGER);
    cstmt.execute();
    int status = cstmt.getInt(3);
    int status2 = cstmt.getInt(2);
    cstmt.close();
    It took me awhile too to get JDBC to call these right.

  • SSRS dataset throws error when another stored procedure is called inside dataset stored procedure

    Hello;
    I am using Report Build 3.0, I have a simple report which gets data using dataset which is created from a Stored Procedure. I have another stored procedure which updates the data in the table which is used for the report. I want to get the live data on report everytime
    the report is run so that I call that stored procedure (sp_updatedata) inside my report dataset stored procedure and here where my report fails as it throws error while creating dataset.
    Here is sample:
    sp_updatedata (this only returns "Command(s) completed successfully"
    Create Proce sp_getReportData
    As
    Begin
    Exec sp_updatedata -- I call it to update the data before it displays on the report
    Select * from customers
    End
    If I remove this line it works.
    Exec sp_updatedata -- I call it to update the data before it displays on the report
    Thanks
    Essa Mughal

    Hi MESSA,
    According to your description, you create a dataset based on a stored procedure. In this procedure, it calls another procedure. Now it throws error when creating dataset. Right?
    In Reporting Services, when creating dataset, all the query or stored procedure will be executed in SSMS. So if the procedure can be executed in SSMS, it supposed to be working in SSRS. However, it has a limitation in SSRS. In a dataset, it can only return
    one result set.
    In this scenario, I don't think it's the issue of calling other procedure inside of procedure. Because we tested in our local environment, it works fine. I guess the sp_updatedata returns a result set, and the "select * from customers" returns
    another result set. This might be the reason cause the error.
    Reference:
    Query Design Tools in Report Designer SQL Server Data Tools (SSRS)
    Reporting Services Query Designers
    If you still have any question, please post the error message and the store procedure (sp_updatedata).
    Best Regards,
    Simon Hou

  • ORA-03115 error when calling a Stored Procedure

    Hi All,
    I'm in the process of porting a Pro/C app from NT to Linux. I've installed 8.1.5 on our Linux box and patched it up to 8.1.5.02.
    It all kind of works ok, except that I'm sometimes getting ORA-03115 errors when the app calls a stored procedure. The call in question looks like this:
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR resprows[50][3998];
    int numret = 0;
    int numrows= 50;
    int done= 0;
    unsigned long resp_id = 0;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL AT DB_NAME EXECUTE
    BEGIN pkg_something.getdata(
    :resp_id, /* IN */
    :numrows, /* IN */
    :done, /* OUT */
    :resprows, /* OUT */
    :numret /* OUT */
    END;
    END-EXEC;
    The stored procedure basically uses the resp_id value to select rows from a table;
    in each row there is a VARCHAR2(4000) column which it copies into the hostarray resprows.
    There may be anything from 1 to numrows returned from the SP.
    Initially, the resprows rows were defined to be size [4000]. Unfortunately, this caused ORA-02005 errors - I then changed the size to [3998], which seemed to fix the 02005's (although I'm unclear as to the reasons why).
    Now I'm getting the 03115 errors when calling the SP. The oracle manual is not very helpful on what this error means.
    This all works chipper on NT.
    Any ideas?
    Thanks in advance,
    Nigel.
    PS: The database the app is talking to is still hosted on NT.
    null

    Histon FTM wrote:
    ORA-04063: package body "LAZARUS.LAZARUS" has errors Above, obviously conflicts with the statement that follows:
    >
    The procedure and package have both compiled without errors and the statement on its own works fine in SQL*Plus.I suggest you take a look in the USER_ERRORS view to see, what the errors are.
    And just checking:
    You have schema called LAZARUS, which holds a package named LAZARUS, which holds a procedure called POPULATEGRIDPOSITIONS?
    Edited by: Toon Koppelaars on Oct 1, 2009 5:55 PM

  • Calling a stored procedure runs into an error

    Hello,
    We are testing the Database Adapter.
    In our database we created the following
    - Table tt
    - Package ttpackage, with a procedure with 1 input and 1 output parameter which inserts a record in the tt table.
    (see scripts at bottom of message)
    We created a Database Adapter based upon this Package (Call a stored procedure or function) and register this Database Adapter with the Integration Server.
    When we invoke this Database Adapter and enter the input, we can see in the database that 4 records are created. The Web Service returns after a minute with an error
    How can we solve this problem?
    Regards Leon Smiers
    ERROR
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
         at java.util.Vector.get(Vector.java:710)
         at oracle.tip.esb.server.common.wsif.WSIFInvoker.readResponseHeader(Unknown Source)
    SCRIPT
    drop table tt
    drop sequence seq_tt;
    drop package ttpackage;
    create table tt
    (field1 number(10) not null
    ,field2 varchar2(25) not null
    ,status varchar2(1) not null
    ,primary key (field1)
    create sequence seq_tt;
    create or replace package ttpackage is
    procedure insert_tt(
    pi_field2 in tt.field2%type,
    po_status out klacht_data.status%type);
    end;
    show errors
    create or replace package body ttpackage is
    procedure insert_tt(
    pi_field2 in tt.field2%type,
    po_status out klacht_data.status%type) is
    begin
    po_status:='I';
    insert into tt
    (field1, field2,status)
    values(seq_tt.nextval,pi_field2,po_status);
    end insert_tt;
    end;
    show errors
    /

    Hello Dave,
    Thanks for the quick fix.
    I've tested the fix. The 'Array index out of range: 0' disappeared.
    I get, unfortunately, the following error. I already described the steps I take in the first message. Based upon the TTpackage I create a Database adapter, register it with the ESB and invoke the URL from the ESB.
    Regards Leon
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.xml.parser.v2.XMLDOMException: Ongeldige naamruimte http://xmlns.oracle.com/pcbpel/adapter/db/OCOP/TTPACKAGE/INSERT_TT/ voor prefix xmlns
         at oracle.xml.parser.v2.XMLElement.setAttributeNS(XMLElement.java:1015)
         at oracle.tip.esb.utils.DOMUtil.copyContentsTo(Unknown Source)
         at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.raiseEvent(Unknown Source)
         at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.processMessage(Unknown Source)
         at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:869)
         at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:349)
         at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:460)
         at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
         at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
         at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:177)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    </faultstring><faultactor></faultactor></env:Fault></env:Body></env:Envelope>

  • ORABPEL-11809 - call a stored procedure - error in OUT parameter

    Hi all.
    I have a problem in a BPEL process that calls a stored procedure.
    I create a Partner Link that calls a stored procedure in the database. That procedure returns a type that is a table (is defined as a type of the database).
    When I deploy the process I have the following error:
    <messages>
    - <input>
    - <WC01_Pesquisa_Ut_InputVariable>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters">
    - <InputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/">
    <P_NIR xmlns="">
    165968274
    </P_NIR>
    <P_NOME_COMPLETO xmlns="">
    carla diogo
    </P_NOME_COMPLETO>
    <P_SEXO xmlns="">
    Feminino
    </P_SEXO>
    <P_DATA_NASC xmlns="">
    2007-03-01
    </P_DATA_NASC>
    <P_NATURALIDADE xmlns=""/>
    </InputParameters>
    </part>
    </WC01_Pesquisa_Ut_InputVariable>
    </input>
    - <fault>
    - <remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
    - <part name="code">
    <code>
    17002
    </code>
    </part>
    - <part name="summary">
    <summary>
    file:/oracle/product/10.1.3/SOA/Integration10131/bpel/domains/default/tmp/.bpel_SaudeIdentificarCidadao_5.0_e3768f57d137443e1ba52d4a6d809426.tmp/WC01_Pesquisa_Ut.wsdl [ WC01_Pesquisa_Ut_ptt::WC01_Pesquisa_Ut(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'WC01_Pesquisa_Ut' failed due to: Error registering an out parameter.
    An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    ; nested exception is:
         ORABPEL-11809
    Error registering an out parameter.
    An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    Check to ensure that the parameter is a valid IN/OUT or OUT parameter of the API. Contact oracle support if error is not fixable.
    </summary>
    </part>
    - <part name="detail">
    <detail>
    Internal Exception: java.sql.SQLException: Io exception: Connection resetError Code: 17002
    </detail>
    </part>
    </remoteFault>
    </fault>
    </messages>
    The code of the XSD created when I create the partner link is:
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/"
    elementFormDefault="unqualified" attributeFormDefault="unqualified">
    <element name="InputParameters">
    <complexType>
    <sequence>
    <element name="P_NIR" type="decimal" db:index="1" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="P_NOME_COMPLETO" type="string" db:index="2" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_SEXO" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_DATA_NASC" type="dateTime" db:index="4" db:type="DATE" minOccurs="0" nillable="true"/>
    <element name="P_NATURALIDADE" type="string" db:index="5" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="OutputParameters">
    <complexType>
    <sequence>
    <element name="PESQUISA_UT" type="db:TABELA_DE_IDS" db:index="0" db:type="Array" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="TABELA_DE_IDS">
    <sequence>
    <element name="PESQUISA_UT_ITEM" type="decimal" db:type="NUMBER" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    </schema>
    Any ideia?
    Thanks in advance.
    Carla

    I'd suggest that you turn on xml validation on the bpel boundaries to make sure that the xml being passed to the adapter is valid. You do this by logging in to bpel console, go to Manage Domain, at the bottom of the Configuration tab, set validateXml to true.
    Then see if it is an xml validation issue - in which case you will have to fix your maps to make sure it is valid indeed.
    Assuming your XML is valid and you are still seeing this error, couple of follow up questions:
    - are you using synonyms ?
    -- note that synonyms are not supported completely by the adapter at this time.
    - could you spell out where your types/sp-pkg resides and what are you connecting as at runtime ?
    -- just to keep things simple enough to debug, i'd do everything as just one user and slowly go to a scheme that you desire.
    HTH

  • Problem calling Stored Procedure returning SETOF UDT (Using Spring)

    I am using Spring's StoredProcedure class to call a stored procedure from a PostgreSql database. It returns a set of user defined data types. I'm having a problem in parsing the results returned.
    The user defined data type :
    CREATE TYPE process_states AS (
    process_name text,
    process_type text
    The stored procedure returns a SET of "process_state" :
    CREATE FUNTION inquire_process_state (.....)
    RETURNS SETOF process_state AS '
    SELECT ....
    I hava a Java class extending the Spring StoredProcedure classs.
    public MyProcStats extends StoredProcedure {
    private class ProcStateCallBackHandler implements RowCallBackHandler {
    public void processRow(ResultSet rs) throws SQLException {
    System.out.println(rs.getString(1));
    public MyProcStats (DataSource ds) {
    super(ds, "inquire_process_state");
    super.setFunction(true);
    declareParameter(new SqlOutparameter("rs", Types.OTHER, new ProcStateCallBackHandler());
    declareParameter(new SqlParameter("family_name", Types.VARCHAR) ;
    While testing this class, I get an errormessage
    "java.sql.SQLException:ERROR: cannot display a value of type record"
    I would appreciate if anyone can point out my mistakes. I tried declaring
    new SqlOutParameter("rs", Types.OTHER, "process_state"), but that didn't help.

    As the related posts suggest, you will need to use direct JDBC code for this.
    Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types.

Maybe you are looking for