Calling a stored proc that has a parameter of a user-defined (array) type

Hi,
Hope someone can help me on this, because I am really struggling...
From a c-program, I am calling stored procedures using the OCI Interface. Everything is OK, when using the standard types (integer, string, date), but I am encountering problems when one of the parameters is of a type that is defined in the database as an array. My application calls multiple array-type parameters in one call, but for the sake of simplicity, I created a test application to only use one.
The following call is working (but it needs to be called using the OCI functions):
BEGIN
p_test_table_num (pin_num1 => T_ARRAY_EH_DEP(1,2,3));
END;
My first step was to have the following combination:
statement: begin p_test_table_num(:pin_num1);end;
parameter: pin_num1
value: t_array_eh_dep(1,2,3)
That lead to the error (when executing the statement): wrong number or types of arguments
Second idea (after a lot of browsing):
statement: begin p_test_table_num(t_array_eh_dep(:pin_num1));end;
parameter: pin_num1
value: 1,2,3
This leads to the error: numeric or value error: number precision too large.
My bind function call looks like:
if (res = OCIBindByName(stmthp, &bndArray[parCount], errhp, (text *) curPar,
-1, (dvoid *) curVal, (sb4) sizeof(curVal), SQLT_NUM, (dvoid *) 0,
(ub2 *) 0, (ub2) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT) != OCI_SUCCESS){
checkerr(errhp, "OCIBindByName", res);
OCIHandleFree(stmthp, OCI_HTYPE_STMT);
return -1;
(in this function curPar is the name of the parameter and curVal contains the value)
I also investigated the BindArrayOfStruct, but I concluded that this is to execute a stored procedure multiple times using different values for the parameters, and that is not what I want.
I really hope someone can give me a direction to look in. I also need to call string and date arrays in the same way...
Thanks
Margit

For those who are interested, I found the solution myself...
To use any user-defined type, you need to perform the following steps:
1. OCIBindByPos or OCIBindByName as you would bind a normal parameter
2. OCITypeByName to get a reference to the type definition in Oracle
3. OCIObjectNew to create a reference to the array (OCI_TYPECODE_VARRAY)
4. Assign a value to the column, for instance use OCIStringAssignText, OCINumberFromInt, OCIDateFromText
5. OCICollAppend ( to add the value from step 4 to collection)
6. OCIBindObject
7. OCIStmtExecute
8. OCITransCommit
Example:
if (res = OCIBindByName(stmthp, &bndArray[parCount], errhp, (text *) curPar,
-1, (dvoid *) curVal, (sb4) sizeof(curVal), SQLT_NTY, (dvoid *) 0,
(ub2 *) 0, (ub2) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT) != OCI_SUCCESS){
checkerr(errhp, "OCIBindByName", res);
OCIHandleFree(stmthp, OCI_HTYPE_STMT);
return -1;
if (res = OCITypeByName(envhp, errhp, svchp,
(CONST text *) currentUserName, (ub4) strlen((CONST char *) currentUserName), /*schema*/
(CONST text *) "T_ARRAY_EH_DEP", (ub4) strlen((CONST char *) "T_ARRAY_EH_DEP"), /* type */
(CONST text *) 0, (ub4) 0, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER,
&type_array_eh_dep) != OCI_SUCCESS){
checkerr(errhp, "OCITypeByName", res);
OCIHandleFree(stmthp, OCI_HTYPE_STMT);
return -1;
OCIArray* eh_dep_array = (OCIArray*)0;
OCINumber eh_dep_num;
OCIObjectNew(envhp, errhp, svchp, OCI_TYPECODE_VARRAY, type_array_eh_dep,
(dvoid*) 0, OCI_DURATION_DEFAULT, TRUE, (dvoid**)&eh_dep_array);
/* get the values from the incoming array */
curArrayItem = SOM_AtrValGetStrList(arrayValuesListMem,
arrayValuesListAtr, arrayValueCount);
do {
if (STR_Eq(curArrayItem, "NULL")){
OCICollAppend(envhp, errhp, (CONST dvoid *)0, &null_ind,
(OCIArray*) eh_dep_array);
else{
tmpInt = atoi(curArrayItem);
OCINumberFromInt(errhp, &tmpInt, sizeof(int), OCI_NUMBER_SIGNED,
&eh_dep_num);
OCICollAppend(envhp, errhp, (CONST dvoid *)&eh_dep_num, (CONST dvoid *) 0,
(OCIArray*) eh_dep_array);
arrayValueCount = arrayValueCount + 1;
curArrayItem = SOM_AtrValGetStrList(arrayValuesListMem,
arrayValuesListAtr, arrayValueCount);
printf( "curArrayItem = %s\n", curArrayItem );
} while (STR_Eq(curArrayItem, "%%%") == falseCN);
arrayValueCount = arrayValueCount + 1; /* skip the %%% */
if (res = OCIBindObject(bndArray[parCount], errhp,
(OCIType *)type_array_eh_dep, (dvoid **) &eh_dep_array,
(ub4 *) 0, (dvoid **) 0, (ub4 *) 0) != OCI_SUCCESS){
checkerr(errhp, "OCIBindObject", res);
OCIHandleFree(stmthp, OCI_HTYPE_STMT);
return -1;
}

Similar Messages

  • 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

  • How to call a stored procedure which has out parameter value

    my code is
    public Connection createConnection() {
                   Connection conn = null;
                        try {
                             Class.forName(DRIVER);
                             conn = DriverManager.getConnection(URL,USER,PASS);
                        } catch (ClassNotFoundException cnfe) {
                             System.err.print("Class not found");
                        } catch (SQLException sqle) {
                             System.err.print("SQLException");
                   return conn;
         public static void main(String args[]){
              StroedProcedure stp = new StroedProcedure();
              Connection con = stp.createConnection();
              try {
                   CallableStatement stproc_stmt = con.prepareCall("{call Account_Summary(?,?,?,?,?,?,?,?)}");
                   stproc_stmt.setString(1, "123456");
                   stproc_stmt.setDate(2, null);
                   stproc_stmt.setString(3, null);
                   stproc_stmt.setString(4, null);
                   stproc_stmt.setString(5, null);
                   stproc_stmt.setString(6, null);
                   stproc_stmt.setDate(7, null);
                   stproc_stmt.setDate(8, null);
                   stproc_stmt.registerOutParameter(1,Types.CHAR);
                   stproc_stmt.registerOutParameter(2,Types.DATE);
                   stproc_stmt.registerOutParameter(3,Types.CHAR);
                   stproc_stmt.registerOutParameter(4,Types.CHAR);
                   stproc_stmt.registerOutParameter(5,Types.CHAR);
                   stproc_stmt.registerOutParameter(6,Types.CHAR);
                   stproc_stmt.registerOutParameter(7,Types.DATE);
                   stproc_stmt.registerOutParameter(8,Types.DATE);
                   stproc_stmt.execute();
                   System.out.println("test "+stproc_stmt.getString(1));
                   ResultSet rs = stproc_stmt.executeQuery();
                  while (rs.next()){
                       System.out.println("result "+rs.getString("ACCPK"));
              } catch (SQLException e) {
                        e.printStackTrace();
         }And the stored procedure is
    CREATE OR REPLACE
    procedure Account_Summary (accpk in out char, incdt out date, bcur out char, bmark out char, tarTE out char, numHold out char, stDt out date, AsDt out date)
    is
    begin
    select account_pk, inception_date, base_currency, benchmark  into accpk, incdt, bcur, bmark
    from account a
    where a.Account_pk=accpk;
    select target_te, number_holdings, start_date, as_date into tarTE, numHold, StDt, AsDt
    from acc_summary asum
    where asum.account_pk=accpk;
    end Account_Summary;but it gives a exception ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at "REPRO.ACCOUNT_SUMMARY", line 4
    ORA-06512: at line 1
    i want to execute a stored procedure which has in , inout or out parameter
    but it can not work

    ========================
    In some contects varchar2 variable limit is 32512 characters... October 16, 2003
    Reviewer: Piotr Jarmuz from Poznan, Poland
    Interesting to note is the fact that varchar2 variables as parameters to stored
    procedures (in in/out out) may be "only" 32512 bytes long.
    I've checked this in Java and Perl. 32512 is the last value that works, for any
    bigger it throws:
    Exception in thread "main" java.sql.SQLException: ORA-01460: unimplemented or
    unreasonable conversion requested
    But in PL/SQL as you said 32767
    Regards,
    Piotr
    =================================
    This i got it from ask tom, well it make sense.... try checking your input with small numbers and strings
    Have fun

  • 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.

  • S'one tell me how to call Oracle Stored Proc from Java

    Hi,
    I have a problem in calling the Stored proc using callable statement.It looks like we are doing the same thing or no..
    Pl..let me know if you can correct me..Am enclosing the stored proc and java Code...
    CREATE OR REPLACE PROCEDURE StoreFTPAddress (FTP in FTPTYPE) is
    BEGIN
    INSERT INTO DES.FTPSERVICE(
    FTPID,
    COMPANYID,
    SERVERNAME,
    DIRECTORY,
    USERNAME,
    PASSWORD,
    INSTRUCTIONS)
    VALUES( FTPID.NEXTVAL,
    FTP.COMPANYID,
    FTP.SERVERNAME,
    FTP.DIRECTORY,
    FTP.USERNAME,
    FTP.PASSWORD,
    FTP.INSTRUCTIONS);
    END;
    JAVA CODE :;
    public String retrieveFormatExtension(String formatName)
    OracleResultSet rs_form = null;
    try
    conn = ConnectionDataObjectImpl.getConnection();
    Statement stmt = conn.createStatement();
    String sql_retrieve = "{call retrieveFormatExtension} " ;
    CallableStatement cst = conn.prepareCall(
    "{call retrieveFormatExtension(?,?)}");
    cst.setString(1," FName ");
    cst.registerOutParameter(1, OracleTypes.VARCHAR); // OUT Parameter
    cst.executeQuery();
    rs_form = (OracleResultSet) cst.getObject(1);
    cst.close();
    catch (SQLException ex)
    System.out.println("SQLException : " + ex.getMessage());
    return null;
    Regards
    Deepauk
    [email protected]
    null

    Syntactically it looks fine. Only thing is u r calling the proc with wrong name. Your procedure takes only one parameter and i.e
    IN type. I think u need to correct ur preparecall statement.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Ayappa:
    Hi,
    I have a problem in calling the Stored proc using callable statement.It looks like we are doing the same thing or no..
    Pl..let me know if you can correct me..Am enclosing the stored proc and java Code...
    CREATE OR REPLACE PROCEDURE StoreFTPAddress (FTP in FTPTYPE) is
    BEGIN
    INSERT INTO DES.FTPSERVICE(
    FTPID,
    COMPANYID,
    SERVERNAME,
    DIRECTORY,
    USERNAME,
    PASSWORD,
    INSTRUCTIONS)
    VALUES( FTPID.NEXTVAL,
    FTP.COMPANYID,
    FTP.SERVERNAME,
    FTP.DIRECTORY,
    FTP.USERNAME,
    FTP.PASSWORD,
    FTP.INSTRUCTIONS);
    END;
    JAVA CODE :;
    public String retrieveFormatExtension(String formatName)
    OracleResultSet rs_form = null;
    try
    conn = ConnectionDataObjectImpl.getConnection();
    Statement stmt = conn.createStatement();
    String sql_retrieve = "{call retrieveFormatExtension} " ;
    CallableStatement cst = conn.prepareCall(
    "{call retrieveFormatExtension(?,?)}");
    cst.setString(1," FName ");
    cst.registerOutParameter(1, OracleTypes.VARCHAR); // OUT Parameter
    cst.executeQuery();
    rs_form = (OracleResultSet) cst.getObject(1);
    cst.close();
    catch (SQLException ex)
    System.out.println("SQLException : " + ex.getMessage());
    return null;
    Regards
    Deepauk
    [email protected]
    <HR></BLOCKQUOTE>
    null

  • Trying to call a stored proc from a form ?

    Hi im trying to call a stored procedure that create a web page
    any where from within a form. (the SP It uses the htp package).
    It does not seem to work.
    lets say in the PL/SQL block before the footer i pu
    <schema>.my_procedure;
    i get a not decleared <schema>.my_procedure error.
    Could someone help !
    Also is there a way to call stored proc directly from the url
    I tried httP://hostname/pls/portal30/<schema>.my_procedure
    unsuccessful.
    thanks

    For it to work, you should grant EXECUTE on your Procedure to
    PUBLIC.
    Have you done that?
    If yes then there is a problem.

  • Call a Stored Procedure that returns a REFCURSOR using ODI Procedure

    Hi,
    I have a scenario wherein the stored procedure (TEST_PROC1) that returns a REFCURSOR. The second procedure(TEST_PROC2) will use the REFCURSOR as inpuut and insert it to a table.
    Now, I need to execute the test procedures (TEST_PROC1 and TEST_PROC2) using the ODI Procedure but I always get error. However, I was able to execute the test procedures using sqlplus. Here is the command I used for sqlplus:
                   var rc refcursor
                   exec TEST_PROC1(:rc);
                   exec TEST_PROC2(:rc);
    PL/SQL Stored Procedure:
    -- TEST_PROC1 --
    create or replace
    PROCEDURE TEST_PROC1 (p_cursor IN OUT SYS_REFCURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT *
    FROM test_table1;
    END;
    -- TEST_PROC2 --
    create or replace
    procedure TEST_PROC2( rc in out sys_refcursor ) is
    FETCH_LIMIT constant integer := 100;
    type TFetchBuffer is table of test_table2%RowType;
    buffer TFetchBuffer;
    begin
    loop
    fetch rc bulk collect into buffer limit FETCH_LIMIT;
    forall i in 1..buffer.Count
    insert into test_table2(
    c1, c2
    ) values(
    buffer(i).c1, buffer(i).c2
    exit when rc%NotFound;
    end loop;
    end;
    Is there a way to call a PL/SQL Stored Procedure that returns a REFCURSOR using ODI Procedure?
    Thanks,
    Cathy

    Thanks for the reply actdi.
    The procedure TEST_PROC1 is just a sample procedure. The requirement is that I need to call a stored procedure that returns a cursor using ODI and fetch the data and insert into a table, which in this case is test_table2.
    I was able to execute a simple SQL procedure (without cursor) using ODI procedure. But when i try to execute the SQL procedure with cursor in ODI, I encountered error.
    Do you have any idea how to do this?

  • Hi can anyone help me im using my iphone to make a call to a number that has been changed two days ago but it automatically says 'called failed' why? please help!

    hi can anyone help me im using my iphone to make a call to a number that has been changed two days ago but it automatically says 'called failed' why? please help!

    Here's a nifty agorithm to fill an array of primes, using a forever loop with a labeled continue statement, from Horton's Beginining Java:public class MorePrimes
      public static void main(String[] args)
        long[] primes = new long[20];    // Array to store primes
        primes[0] = 2;                   // Seed the first prime
        primes[1] = 3;                   // and the second
        int count = 2;                   // Count of primes found - up to now,
                                         // which is also the array index
        long number = 5;                 // Next integer to be tested
        outer:
        for( ; count < primes.length; number += 2)
          // The maximum divisor we need to try is square root of number
          long limit = (long)Math.ceil(Math.sqrt((double)number));
          // Divide by all the primes we have up to limit
          for(int i = 1; i < count && primes[i] <= limit; i++)
            if(number%primes[i] == 0)             // Is it an exact divisor?
              continue outer;              // yes, try the next number
          primes[count++] = number;               // We got one!
        for(int i=0; i < primes.length; i++)
          System.out.println(primes); // Output all the primes

  • How to call user define data type as data type for concurrent parameter

    Hi All,
    i find some difficulty while creating the concurrent program.
    i.e.
    i have one of the parameter of table type i.e. user define data type at PLSql program
    now i need to register same PLSQL program into oracle applications as concurrent program
    but while i am creating Parameters for concurrent program
    How could i define that user define data type at database level in oracle applications using 'Value set' ?
    any one save me from this Problem
    thanks and Regards,
    sai krishna@cavaya.

    Don't think this can be done..
    One way I can think of is to wrap your PL/SQL program under another procedure/package that can accept "normal" parameter,and use/register this wrapper instead of your original pl/sql program.
    HTH

  • How do i declare a user defined table type sproc parameter as a local variable?

    I have a procedure that uses a user defined table type.
    I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
    ,@startDate NVARCHAR(50)
    ,@endDate NVARCHAR(50)
    AS
    BEGIN
    DECLARE @local_accountList AS integer_list_tbltype
    DECLARE @local_startDate AS NVARCHAR(50)
    DECLARE @local_endDate AS NVARCHAR(50)
    SET @local_accountList = @accountList
    SET @local_startDate = @startDate
    SET @local_endDate = @endDate
    CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
    [n] [int] NOT NULL,
    PRIMARY KEY CLUSTERED
    [n] ASC
    )WITH (IGNORE_DUP_KEY = OFF)
    GO

    Why are you asking how to be an awful SQL programmer??  Your whole approach to SQL is wrong.
    We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language? 
    The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL. 
    The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it. 
    There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name. 
    In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Best place in VOimpl java code to call a stored proc to populate results

    Hello all,
    Using JDev 11g, ADF BC and Trinidad.
    I am building an application that is primarily used for searching large amounts of data. We already have stored procedures on the database that perform the searches and dump the results into a holding table (together with a "search id"). I have easilly built a prototype of this application: my view object is simply "select a, b, c from results where search_id = :bv" - I have a service method in the AM that runs the stored procedure, obtains the search ID, binds it to the :bv in the VO and executes the VO's query - it's all working really nicely. Range paging is effective, the VO itself performs well, and I am able to control how long the stored proc runs via setting a timeout value.
    Now, I'd like to generalize this. My thinking is this:
    1). I'll add a custom property to my VO that is the SQL statement needed to call the stored procedure.
    2). I'll add some bind variables to the VO to represent all the query parameters that can be passed to the stored proc. I'll also use custom properties to indicate these are "fake" bvs, and not in the SQL query itself.
    3). The VO's SQL will remain simply "select a, b, c from results where search_id = :bv"
    4). I will (have already tested) override bindParametersForCollection so that the "fake" bind variables aren't bound into the SQL.
    Now, the question: I want to override some method in the VO's java code to call the stored procedure. The stored proc needs to be called before the actual query for the VO is run, and also before the method getQueryHitCount is called (so that the count is correct). What is the method that would be the "best" place to do this? My current thinking is that I would put the call in an over-ridden executeQueryForCollection call. As far as my analysis has gone, it seems to be always called before getQueryHitCount, but I have no way of knowing if this is completely safe.
    Any thoughts from the BC experts out there?
    Best regards,
    John

    John,
    from your description I understand that you essentially program the VO yourself. So I suggest that you read chapter 35.9 of the 'Fusion Developer’s Guide for Oracle Application Development Framework' (I guess you know where to find it). Since you still call the actual SQL not all of the chapter apply, but you get the idea how it works.
    And yes you analyzed the behavior correct. executeQueryForCollection() is allways called bevore getQueryHitCount().
    Timo

  • 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

  • Clearing Oracle Parameters to call diferent stored procs

    Sub Main
    Do While i < 3
    make_excel(i)
    i = i + 1
    Loop
    end Sub
    Sub make_excel(ByVal array As Integer)
    objCmd.Parameters.Add(New OracleParameter("p_cursor", OracleType.Cursor)).Direction = ParameterDirection.Output
    end Sub
    objCmd.Parameters.Clear()
    objCmd.Parameters.Remove("p_cursor")

    I agree with you. I was looking into mod_plsql, but it turns out that their development standards include not using Oracle HTTP server. The whole reason why they want to be able to execute a stored proc based on what is specified in an XML doc is that they want to avoid having to change their middle-tier configurations anytime a new stored proc or a change in stored proc parameters is made. I'm not familiar with what all is involved with .NET and the middle-tier, but supposedly this way, they can specify any stored procedure name and its parameters in an XML file. The XML is then suppose to be passed on to an Oracle stored procedure which will parse the XML and dynamically execute the stored procedure that was specified in the XML.
    Here is an example of the XML:
    '<Root>
      <PackageName>TEST_PKG</PackageName>
      <ProcedureName>TEST_PROC</ProcedureName>
        <Parameters> 
        <Parameter>
            <Name>EmpID</Name>
            <Value>12345</Value>
        </Parameter>
        <Parameter>
            <Name>Org</Name>
            <Value>ABC</Value>
        </Parameter>
        </Parameters>
    </Root>I basically need to parse out the pkg/proc names:
      SELECT t.COLUMN_VALUE.extract('//PackageName/text()').getstringval() PkgName,
             t.COLUMN_VALUE.extract('//ProcedureName/text()').getstringval() ProcName
         INTO v_pkg_name, v_proc_name
         FROM TABLE(xmlsequence(XMLTYPE(v_XML_input) .extract('/Root'))) t;...and then execute the procedure:
        EXECUTE IMMEDIATE 'BEGIN '||v_pkg_name||'.'||v_proc_name||'(:a, :b, :c); END;'
          using in v_in_param1, v_in_param2, out v_XML_output;The problem is that this approach is very complicated since there can be any number of IN/OUT parameters and of various datatypes. I would have to create all kinds of possible bind variables!

  • How to call a stored procedure that use a type defined in a package?

    Hi all,
    this is stored procedure:
    GET_GIORNATAEVENTO( in_nome_servizio IN VARCHAR2,
    out_dati_aggiornati OUT TAB_VARCHAR2);
    TAB VARCHAR2 is defined in the package specification:
    TYPE tab_varchar2 IS TABLE OF VARCHAR2(5) INDEX BY BINARY_INTEGER;
    and this is the name of the package: PKG_SERVIZI_MMSPUSH.
    This is my php script:
    <?php
    // Connect to database...
    $c=OCILogon("venus_vfl", "venus_vfl", "venvi");
    if ( ! $c ) {
    echo "Connessione non riuscita: " . var_dump( OCIError() );
    die();
    echo "<br>PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO</br> ";
    echo "<br> </br>";
    // Call database procedure...
    $in_servizio = "MOTO";
    $s = OCIParse($c, "begin PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO(:bind1, :bind2); end;");
    OCIBindByName($s, ":bind1", $in_servizio);
    OCIBindByName($s, ":bind2", $out_esito);
    OCIExecute($s,OCI_DEFAULT);
    echo "OUT_DATI_AGGIORNATI= " . $out_esito;
    // Logoff from Oracle
    OCILogoff($c);
    ?>
    How to test stored procedure to get the output parameter?
    Thanks in advance.

    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

  • How to call a stored proc

    Hi,
    I want to call a stored procedure which returns 4 VARCHAR as a output
    parameter, and use 2 VARCHAR as a input parameter. How can I do
    that ?
    the signature of the SP is like this
    dec(
    in_a IN VARCHAR2,
    in_b IN VARCHAR2,
    out_c OUT VARCHAR2,
    out_d OUT VARCHAR2,
    out_e OUT VARCHAR2,
    out_f OUT VARCHAR2,
    Thank You
    PS: sorry if there's a repost, my mail server seems to have some problems..

    CallableStatement cstmt = con.prepareCall( "{call storedProcName(?,
    cstmt.registerOutParameter(1, java.sql.Types.VARCHAR);
    cstmt.registerOutParameter(2, java.sql.Types.VARCHAR);
    cstmt.registerOutParameter(3, java.sql.Types.VARCHAR);
    cstmt.registerOutParameter(4, java.sql.Types.VARCHAR);
    cstmt.registerInParameter(5, java.sql.Types.VARCHAR);
    cstmt.registerInParameter(6, java.sql.Types.VARCHAR);
    cstmt.executeQuery();
    -Krishna
    "Fabien" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I want to call a stored procedure which returns 4 VARCHAR as a output
    parameter, and use 2 VARCHAR as a input parameter. How can I do
    that ?
    the signature of the SP is like this
    dec(
    in_a IN VARCHAR2,
    in_b IN VARCHAR2,
    out_c OUT VARCHAR2,
    out_d OUT VARCHAR2,
    out_e OUT VARCHAR2,
    out_f OUT VARCHAR2,
    Thank You
    PS: sorry if there's a repost, my mail server seems to have someproblems..
    >
    >

Maybe you are looking for

  • Any problems with Photoshop Elements 10 in Mac OS X v10.7 Lion?

    Are there any problems in using Photoshop Elements 10 in Mac OS X v10.7 Lion?

  • HT5361 After upgrading to Mountain Lion in July I am no longer able to receive in Mail.

    After upgrading to Mountain Lion in July I am no longer able to receive my email in Mail. I am able to send, but not receive. How do I fix this? I have been having to do my email on the web and want to receive my email by Mail.

  • Reader plug in missing

    Safari 5.1.1 on Lion, keeps telling me plug in is missing for Adobe Reader X 10.1.1. I have downloaded it a couple of times and it works fine any where outside of Safari. It works fine in Firefox. Any advice?

  • Beats audio program not work

    hi i have a HP Pavilion dv6-6c20ed Entertainment Notebook it a very nice thing but i have a question the beat program dos not work i have a beats headset but if i want to trun the bass to high its not work can you please help me?

  • Trading in an ipod

    I have a question about trading in a 3G ipod. I first had a mini, but when my sister's 3G broke, she bought a photo Ipod, and I got the replacement 3G. However, ever since I got it I had the impression that it wasn't new, but just one that they had p