Pass array in Oracle 9i procedure

I would like to pass an array in a procedure. I would like to know how can we use array in Oracle 9i.
I would like to use sp's to insert data from frontend. For this i need an array to pass the values of master and transactions. Is there any other way to do this plz let me know. All suggestions are welcome.

This is the Oracle9i Lite forum. Please post your message on teh Oracle9i forum

Similar Messages

  • Passing arrays to Oracle Stored procedure.

    Have any body passed arrays to Oracle stored procedures while the app is running in Weblogic app server. I am able to pass the arrays with regular JDBC connection. If I run the same piece of code using a connection recieved from the datasource of weblogic server, its not working. I am getting serialization errors with the ArrayDescriptor class. Looks like the ArrayDescriptor is not serializable.
    Does anybody know solution/workaround to pass arrays ?
    Thanks in advance

    you could write a wrapper class that extends ArrayDescriptor and implements serializable...
    for example your class would look something like this.
    public class MyArrayDescriptor extends ArrayDescriptor
    implements Serializable
    in your regular code use the wrapper class in place of the ArrayDescriptor (it will contain all the same methods as the real ArrayDescriptor) and you should be able to toss your wrapper class anywhere you please.

  • Passing array to oracle stored procedure in VC++ 2005

    Hi,
    I am try to send an array of integers to a stored procedure via ODBC 10.2.0.3 on VC++2005 enviornment. I get the below error
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'MYPROC1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored ... Error Code = 6550
    []E R R O R
    The same code works if I use an INSERT statement.
    SQLUSMALLINT* rowsProcessed = new SQLUSMALLINT;
    RETCODE nRetCode;
    const int arraySize = 200;
    long ptrVal[arraySize];
    long ptrInd[arraySize];
    long ptrStatus[arraySize];
    for (int i = 0; i < arraySize; i++)
    ptrVal = i;
    ptrInd = 0;
    nRetCode = SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAM_BIND_TYPE, SQL_PARAM_BIND_BY_COLUMN, 0);
    // assign the number of sets of parameters that are to be inserted
    nRetCode = SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAMSET_SIZE, (SQLPOINTER)iSizeOfArray, 0);
    // assign an array to retrieve status info for each row of parameter values
    nRetCode =SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAM_STATUS_PTR, (SQLPOINTER)ptrStatus, 0);
    // assign a buffer to store the number of sets of parameters that have been processed
    nRetCode = SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAMS_PROCESSED_PTR, (SQLPOINTER)rowsProcessed, 0);
    nRetCode = SQLBindParameter(m_hstmt, nParamIndex, nDirection, SQL_C_LONG, SQL_INTEGER, 0, 0, ptrVal, 0, ptrInd);
    //suceeds
    SQLPrepare(m_hstmt, (SQLCHAR*)"INSERT INTO my_table VALUES (?)", SQL_NTS);
    //fails
    SQLPrepare(m_hstmt, (SQLCHAR*)"{CALL mypackage.myproc1(?)}", SQL_NTS);
    SQLExecute(m_hstmt);
    package is
    create or replace package mypackage
    as
    type mytable is table of binary_integer;
    procedure myproc1( l_tab in mytable);
    end;
    show errors
    create or replace package body mypackage
    as
    procedure myproc1( l_tab in mytable)
    as
    begin
    insert into my_table values (100);
    commit;
    FORALL i IN l_tab.first .. l_tab.last
    INSERT into my_table values( l_tab(i) );
    end;
    end;
    any ideas?

    I believe when you're doing it with an insert, you're saying "execute this insert statement a bunch of times, here's all the values in advance", which is different than passing an array to a stored procedure where you want it to execute once.
    Oracle's ODBC driver doesnt support Associative Arrays (aka index-by tables).
    Hope it helps,
    Greg

  • Passing array to Oracle stored procedure

    Is it possible to pass an array (TYPES.Array) to an oracle stored procedure in WLI? I know it can be done in vanilla jdbc.
    I have tried to do this but I'm getting this exception:
    java.sql.SQLException: Fail to convert to internal representation:

    Well well well......I was able to fix the same.
    The implementation for writeSQL is the catch. We need to give the conversion only in that.
    Anyway, thanks.

  • Pass array to oracle stored procedure

    I have such a problem: I have to pass array to stored procedure, so I declare type:
    create type tNumberArray as table of number
    and create procedure:
    create or replace procedure proc_1 (in_param in tNumberArray) as
    .... BODY OF PROCEDURE ...
    when I call this procedure from C# like this:
    int []pParam = new int[3] {1,2,3};
    OracleCommand cmd = new OracleCommand("proc_1", dbConn);
    cmd.CommandType = CommandType.StoredProcedure;
    OracleParameter param14 = new OracleParameter("param", OracleDbType.Decimal);
    param14.Value = pParam;
    param14.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
    param14.Size = 3;
    param14.Direction = ParameterDirection.Input;
    cmd.Parameters.Add(param14);
    cmd.ExecuteNonQuery();
    an error occures. It say that there invalid number or type of parameters.
    But when I declare both type and procedure in a package everything goes fine.
    What is the matter? Did anybody have the same problem?

    Not I got next problem:
    when I cannot pass parameter to stored procedure and get array fro it. In other words returning array from procedure and passing some input parameters to it does not word!
    Does anybody know why it happens?

  • Passing data from Oracle stored procedures to Java

    We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
    We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
    We're considering one of the 2 following scenarios:
    passing objects and lists of objects (DB object types defined on the schema level)
    passing a sys_refcursor
    We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
    I'd appreciate any hints.

    user1754151 wrote:
    We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
    We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
    We're considering one of the 2 following scenarios:
    passing objects and lists of objects (DB object types defined on the schema level)
    passing a sys_refcursor
    We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
    I'd appreciate any hints.If logic is already written in DB, and the only concern is of passing the result to java service side, and also from point of maintenance problem and flexibility i would suggest to use the sys_refcursor.
    The reason if Down the line any thing changes then you only need to change the arguments of sys_refcursor in DB and as well as java side, and it is much easier and less efforts compare to using and changes required for Types and Objects on DB and java side.
    The design and best practise keeps changing based on our requirement and exisiting design. But by looking at your current senario and design, i personally suggest to go with sys_refcursor.

  • How to pass ARRAY to Oracle Procedure

    Hi
    We are using BC4J with JSP in our project. We need to send an Array to the procedure.
    Could somebody provide some info as how this can be achieved.

    A while back, I used a SQLJ client to call a Java (also SQLJ) stored procedure and I needed to pass an array of strings to the procedure. I did something like this:
    Java Class that was loaded in DB:
    public class MyClass
    // method that the stored procedure uses
    public static void CALL_DOSTUFF(String a,
    oracle.sql.ARRAY b,
    oracle.sql.ARRAY c)
    String[] bb = (String[])b.getArray();
    String[] cc = (String[])c.getArray();
    doStuff(a,bb,cc);
    public static void doStuff(String a,
    String[] b,
    String[] c)
    // process the input
    In the database I added the type:
    create or replace type STR_ARRAY as table of varchar2(20);
    and the procedure:
    create or replace procedure CALL_DOSTUFF(a varchar2,
    b STR_ARRAY,
    c STR_ARRAY)
    as
    language java
    name 'MyClass.CALL_DOSTUFF(java.lang.String,
    oracle.sql.ARRAY,
    oracle.sql.ARRAY)';
    I then used jpub to publish a STR_ARRAY.java file. I compiled this and used it with my SQLJ client to call to the stored procedure. The STR_ARRAY constructor takes a String[], so you do something like this in the SQLJ client:
    String x = "X";
    String y = {"y1","y2"};
    String z = {"z1","z2"};
    STR_ARRAY y1 = new STR_ARRAY(y);
    STR_ARRAY z1 = new STR_ARRAY(z);
    #sql {CALL CALL_DOSTUFF(:x,:y1,:z1)};
    Hope this helps.

  • Passing parameters to oracle stored procedure in business objects universe

    Hello,
    Wanted to create a web intelligence usind oracle stored procedure.
    Create the  following SP
    create or replace procedure proc_name1
        proc_freq in number,
        proc_cur1 in out sys_refcursor
    as
    begin
        INSERT INTO
                cc    VALUES
                ( 'Frequency Value = ' || proc_freq, SYSDATE) ;
        COMMIT ;   
        --daily
            if(proc_freq = 2) then
            open proc_cur1 for SELECT
                        EVENT_DATE
                    FROM rqm_mapsigng_dly_stats;
            end if;
    end;
    tried using the above SP in universe, it is needed to pass the parameter for proc_freq, when i pass value 2 , in oracle it is passed as 0(is being traced in rqm_checkpoint  table)
    Hence the table cannot be inserted in the universe.
    Can anyone tell why the value is not being passed correctly

    I believe when you're doing it with an insert, you're saying "execute this insert statement a bunch of times, here's all the values in advance", which is different than passing an array to a stored procedure where you want it to execute once.
    Oracle's ODBC driver doesnt support Associative Arrays (aka index-by tables).
    Hope it helps,
    Greg

  • Pass xmltype to oracle stored procedure

    I need to pass an xmltype from java to an oracle stored procedure. Does anybody have any sample code to do this? I am using jdeveloper 10.1.2
    Thanks
    MM

    Oracle provides several ways of passing objects to and from java to Oracle Stored Procedure.
    One way is to directly create oracle.sql.STRUCT object and pass array of values to this object. Another way is to implement java.sql.SQLData or oracle.sql.ORAData interfaces in your class and pass this class to setObject function.
    It is all well described in manual in chapter "Working with Oracle Object Types", there is also a lot of examples in this chapter and on the web.
    http://download-uk.oracle.com/docs/cd/B19306_01/java.102/b14355/oraoot.htm - Working with Oracle Object Types
    Some of the examples:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/ObjectOracleSample/Readme.html
    http://javaalmanac.com/egs/java.sql/InsertObjectOraclePreparedStatement.html

  • How to pass values to Oracle store procedure in Crystal Report

    Hi all,
    I am newbie on passing values to stored procedure parameters. I created a Crystal Report using the Crystal Report wiward with PULL method and data come from Oracle stored procedure. In an ASP.NET page, I have stored two values in Session and need to pass them as input parameters to Oracle stored procedure to print the report. In Crystal reports 2010 once you connect to a stored-procedure as data source, it automatically creates the parameter fields with Crytal Report Viewer. Please show me how I pass values to store procedure at runtime automatically.
            'Set the parametter value
            myReport.SetParameterValue("@P_COURSE", "CoursetNo")
            myReport.SetParameterValue("@P_CLASS", "ClassNo")
        End Sub
    I tried to apply above codes from Brian Bischof book but display the error from the following lines:
            myReport.SetParameterValue("@P_COURSE", "CoursetNo")
            myReport.SetParameterValue("@P_CLASS", "ClassNo")
    I also enclosed my code. Any experts, please let me know anything wrongs on my code . I tried several methods that searching via google, but did not solve my issues. Thanks.
    Edited by: avt2K7 on Mar 15, 2011 7:02 AM

    Hi,
    Thank you for your response. Here are the detailed code and error as following:
    Please show what I am missing in my below VB.NET codes:
    ===========================================================================================
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            LogonToTables("username", "password", "servername", "")
        End Sub
        Private Sub LogonToTables(ByVal myUserId As String, ByVal myPassword As String, ByVal myServerName As String, ByVal myDataBaseName As String)
            Dim Course, Class As String
            Course = Session.Item("CourseNumber"))
            Class = Session.Item("ClassNumber"))
            Dim myReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            myReport.Load(Server.MapPath("CrystalReport1.rpt"))
            Dim myTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
            'Set the database properties and security credentials
            Dim myConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
            myConnectionInfo.ServerName = "servername"
            myConnectionInfo.DatabaseName = ""
            myConnectionInfo.UserID = "username"
            myConnectionInfo.Password = "password"
            'Apply the ConnectionInfo to the report tables
            Dim myTables = myReport.Database.Tables
            For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
                myTableLogonInfo = myTable.LogOnInfo
                myTableLogonInfo.ConnectionInfo = myConnectionInfo
                myTable.ApplyLogOnInfo(myTableLogonInfo)
            Next
            'Set the parametter value to Crystal Report parameter named P_COURSE and P_CLASS
            myReport.SetParameterValue("@P_COURSE", "Course")
            myReport.SetParameterValue("@P_CLASS", "Class")
        End Sub
    =================================================================================
    I put a break point to debug but display the error at the following lines:
            myReport.SetParameterValue("@P_COURSE", "Course")
            myReport.SetParameterValue("@P_CLASS", "Class")
    Eventhough, if I set a specific value to Course=1000 and Class = math and still receive the error:
    Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
    I tried several sources from Google search but it is not working. I really appreciate any detailed code either in C# or VB.NET to solve my issues. Thanks in advance.

  • Passing array to pl/sql procedure - pls-00306 wrong number/types of args

    its oracle 10.2 database;
    I have a procedure with array parameters based on simple sql types.
    eg
    create or replace type vt_attrname is table of varchar2(50);
    Now my call to the procedure works when the array is empty;
    as soon as I bulk collect into my local array, I get a compilation error.
    eg
    declare
    my_array  vt_attrname;
    begin
    select label
      bulk collect
      into my_array
      from table_name
    where 1=1;
    my_proc(p_array=>my_array);  -- syntax error
    end;if I pass null the call works but obviously array is empty.
    I have read something about varray's being incompatible between sqltypes and pl/sql.
    How do I get around this problem?
    The bulk collect is working okay.
    A small example would be appreciated.

    Yep, I spotted the syntax error earlier.
    However even though that seems to compile ok, I still get the problem with my package call.
    heres the actual call from the code
    vt_attrname and vt_attrvalues are types declared on another schema.
    I have redeclared them on the current schema now.
    create or replace type vt_attrname is table of varchar2(50);
    create or replace type vt_attrvalue is table of varchar2(500);
    create procedure <name>
    as
    v_cardapplattrtag   vt_attrname;
    v_cardapplattrvalue vt_attrvalue;
      for cardappl_cur in
        (select cardappl_id 
           from ci_cardappl
          where custcard_id = cur.document_logical_number)
        loop
        select label
          bulk collect
          into v_cardapplattrtag
          from ci_applver_attribute
          where applver_id = v_applver_id;
          v_array_size := v_cardapplattrtag.count;
        -- populate this array
        -- ppt_cardapplattrtag comes from ci_pplver_attribute
        --ppt_cardapplattrvalue -- various
    cci_setcardappl.SetCardApplAttrValue(
              pn_cardappl_id                 =>     cardappl_cur.cardappl_id,
              ppt_cardapplattrtag     =>      v_cardapplattrtag, -- works when null
              ppt_cardapplattrvalue   =>     NULL,
              pn_cardapplattrsize     =>     v_array_size,
              pv_arn                  =>     cur.application_request_id,
              pv_commit               =>    'FALSE');and the procedure protototype is
    PROCEDURE SetCardApplAttrValue(
              pn_cardappl_id           IN     NUMBER,
              ppt_cardapplattrtag     IN     VT_BPATTRNAME DEFAULT NULL,
              ppt_cardapplattrvalue   IN     VT_BPATTRVALUE DEFAULT NULL,
              pn_cardapplattrsize     IN     NUMBER,
              pv_arn                  IN     VARCHAR2,
              pv_commit               IN     VARCHAR2 DEFAULT 'FALSE');Edited by: Keith Jamieson on Sep 23, 2009 10:42 AM

  • Passing array from java stored procedure to plsql

    I have a java store procedure that is parsing an xml document and returning element values to my plsql application(8.1.7). I'm mapping a java.lang.String return type to VARCHAR2. However I'm running into the 4k limit when trying to return a string from java that is over 4k. Truncation of varchar returning over 4k is a known issue in 8i.
    So my next idea was to split that value of the element into 2000char and put in an array then pass that back to the plsql procedure. I know that oracle.sql.ARRAY can be converted into a plsql TABLE. But I believe you can only use the oracle.sql.ARRAY type when you are doing jdbc programming and are working with a connection.
    SO FINALLY MY QUESTION IS...
    Can anyone think of a solution that will allow me to pass over 4k of character data from my java stored procedure (not jdbc), back to my plsql app?
    Thanks.

    My understanding is that oracle 8 has a 4k limitation on any plsql function return data. A varchar can hold 32k within a function/package, but it cannot return more than 4k outside it's scope.
    Do you have an example you could share where you use the clob as a return type?
    Thanks!

  • Passing array as input to procedure

    Hi,
           create or replace type t_employee_id is table of number;
          create or replace type t_employee_name  is table of varchar2(4000);
    I have created type for array input.
    declare
      p_id t_employee_id;
      p_name t_employee_name;
    begin
       p_id(1):=12;
      p_name(1):='no22';
    p_id(2):=300;
    p_name(2):='XXX';
    p_id(3):=4;
    p_name(3):='bn';
      sp_sample(p_id => p_id,
                p_name => p_name);
    end;
    CREATE OR REPLACE PROCEDURE sp_sample(p_id   IN t_employee_id,
                                          p_name IN t_employee_name) IS
      v_error EXCEPTION;
      PRAGMA EXCEPTION_INIT(v_error, -23456);
    BEGIN
      FORALL i IN 1 .. p_id.COUNT SAVE EXCEPTIONS
        INSERT INTO employee
          (employee_id, employee_name)
        VALUES
          (p_id(i), p_name(i));
      COMMIT;
    EXCEPTION
      WHEN v_error THEN
        FOR i IN 1 .. SQL%BULK_EXCEPTIONS.COUNT LOOP
          dbms_output.put_line('Error:' || SQL%BULK_EXCEPTIONS(i)
                               .ERROR_INDEX || 'Message' ||
                               SQLERRM(-sql%BULK_EXCEPTIONS(i).ERROR_CODE));
          dbms_output.put_line('\n');
        END LOOP;
    END sp_sample;By compling the above code I getting error like this
    ORA-06531-Reference to uninitialized collection.
    Thanks in advance.

    ... and The Holly Book of All PL/SQL Programmers (also known as: Oracle® Database PL/SQL Language Reference) says:
    Collection Initialization
    Until you initialize it, a nested table or varray is atomically null; the collection itself is null, not its elements. To initialize a nested table or varray, you use a constructor, a system-defined function with the same name as the collection type. This function constructs collections from the elements passed to it.
    You must explicitly call a constructor for each varray and nested table variable. Associative arrays, the third kind of collection, do not use constructors. Constructor calls are allowed wherever function calls are allowed.
    Example 5-10 initializes a nested table using a constructor, which looks like a function with the same name as the collection type.
    Example 5-10 Constructor for a Nested Table
    DECLARE
    TYPE dnames_tab IS TABLE OF VARCHAR2(30);
    dept_names dnames_tab;
    BEGIN
    dept_names := dnames_tab('Shipping','Sales','Finance','Payroll');
    END;
    Because a nested table does not have a declared size, you can put as many elements in the constructor as necessary.------------------------------------------------------------------------------------------------------------------------------
    It's very abstract and not intuitive but there is a difference between 'the collection is NULL (not initialized)' and 'the collection that is not NULL (initialized), but it has no elements' and 'the collection that has all elements NULL'. If you declare a variable of VARCHAR2(30) datatype then Oracle will allocate memory for this variable. However if you have a variable of a collection type then simply declaring it is not enough - you have to call a constructor so Oracle can allocate memory for this variable before it's first use.
    So you can have:
    declare
      p_id t_employee_id := t_employee_id();
      p_name t_employee_name := t_employee_name();
    begin
       p_id(1):=12;
      p_name(1):='no22';
    p_id(2):=300;
    p_name(2):='XXX';
    p_id(3):=4;
    p_name(3):='bn';
      sp_sample(p_id => p_id,
                p_name => p_name);
    end;or simply
    declare
      p_id t_employee_id := t_employee_id (12, 300, 4);
      p_name t_employee_name := t_employee_name ('no22', 'XXX', 'bn') ;
    begin
      sp_sample(p_id => p_id,
                p_name => p_name);
    end;

  • Passing ARRAY object to stored procedure problem

    I've created a stored procedure that accepts as a parameter a
    database type
    that I have defined as a VARRAY. (create type XXX)
    When I attempt to pass an ARRAY object to this stored procedure
    through JDBC
    (Thin-client driver) I recieve the Oracle internal error ORA-
    00600 and the
    first "parameter" is [12760].
    Has anyone else attempted the same sort of thing w/ success?
    I am including the Java source code to help the investigation
    private void chad(int[] railcarIds) throws NonFatalDBException,
    FatalDBException {
    CallableStatement theStatement = null;
    try {
    theStatement = this.getDatabaseConnection().prepareCall("{call
    RomsRepairPackage.chad(?)} ");
    // create an ARRAY object to send to the procedure
    ArrayDescriptor ad =
    ArrayDescriptor.createDescriptor("RAILCARIDVARRAYTYPE",
    this.getDatabaseConnection());
    ARRAY theArray = new ARRAY(ad, this.getDatabaseConnection(),
    railcarIds);
    // set the input parameter which is the array of railcar ids
    ((OracleCallableStatement)theStatement).setARRAY(1, theArray);
    theStatement.execute();
    theStatement.close();
    } catch (SQLException sqle) {
    System.out.println("ouch");
    Thank you for any help,
    Chad Sheley
    Senior Consultant
    Cap Gemini
    Des Moines, IA
    null

    Hi
    Can u plzz help me as to how did u write the procedure to take arrays as input.I also have to write aprocedure that takes arrays and returns arrays.Plzz can u give me a working sample as I have not found any help anywhere
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Chad Sheley ([email protected]):
    I've created a stored procedure that accepts as a parameter a
    database type
    that I have defined as a VARRAY. (create type XXX)
    When I attempt to pass an ARRAY object to this stored procedure
    through JDBC
    (Thin-client driver) I recieve the Oracle internal error ORA-
    00600 and the
    first "parameter" is [12760].
    Has anyone else attempted the same sort of thing w/ success?
    I am including the Java source code to help the investigation
    private void chad(int[] railcarIds) throws NonFatalDBException,
    FatalDBException {
    CallableStatement theStatement = null;
    try {
    theStatement = this.getDatabaseConnection().prepareCall("{call
    RomsRepairPackage.chad(?)} ");
    // create an ARRAY object to send to the procedure
    ArrayDescriptor ad =
    ArrayDescriptor.createDescriptor("RAILCARIDVARRAYTYPE",
    this.getDatabaseConnection());
    ARRAY theArray = new ARRAY(ad, this.getDatabaseConnection(),
    railcarIds);
    // set the input parameter which is the array of railcar ids
    ((OracleCallableStatement)theStatement).setARRAY(1, theArray);
    theStatement.execute();
    theStatement.close();
    } catch (SQLException sqle) {
    System.out.println("ouch");
    Thank you for any help,
    Chad Sheley
    Senior Consultant
    Cap Gemini
    Des Moines, IA<HR></BLOCKQUOTE>
    null

  • Passing array parameters to Stored procedure

    Hi,
    I need to call a procedure repeatedly with different set of parameters. Instead To do this, I can form a parameter arrays and pass it to the procedure. This is working fine with Oracle 8.1.7 database and Oracle 8.1.7 odbc driver.
    Is there any difference in the way 8.1.6 Oracle ODBC driver behave? When we use the same code with 8.1.6 ODBC driver (with either 8.1.6 database or 8.1.7 database), and pass an array of n elements to the stored procedure, first elemet in the array is processed correctly and for the remaining n-1 times the same value is getting used (which leades to a unique constraint violation since procedure in this case does an insert). Soem of our clients are on 8.1.6 and so we need to get this working on it too.
    Also are you aware if Microsoft ODBC driver implements this correctly. When we traced with ODBC trace, it was executing the procedure n times one after the other thereby simulating the effect but poor performance. (MDAC 2.6).
    Is there any extra settings to be done?
    Thanks
    Sree

    Hi Justin,
    When I installed 8.1.6.6 ODBC driver this problem went off, but I recieved another problem.
    I am getting
    "ORA-01460 unimplemented or unreasonable conversion requested"
    on execution of some procedures with parameter arrays. They work fine with 8.1.7.0.
    Any idea? Is it suggested that I use 8.1.7 ODBC driver with 8.1.6 server/client? Will it create some other problem?
    Thanks
    Sree

Maybe you are looking for