Page 1 of 1

Can i Pass String Array to Procedure

Posted: Wed 01 Feb 2012 08:27
by jiayu821
i write a procedure which use a string array as parameter,
can i pass the string array as parameter to it using asp.net
in direct mode,

in oracle
i write
create or replace type T_Sale_Type as table of varchar2(2);

create or replace procedure P_Query(v_sale_type T_Sale_Type)

Posted: Wed 01 Feb 2012 13:29
by Pinturiccio
Yes, you can. For example you can use the following code in your asp.net project:

Code: Select all

            OracleConnection conn = new OracleConnection("host=***;port=1521;user id=***;password=***;sid=orcl1120;direct=true;");
            conn.Open();
            OracleCommand comm = new OracleCommand("P_Query", conn);
            comm.CommandType = System.Data.CommandType.StoredProcedure;
            OracleTable table = new OracleTable(OracleType.GetObjectType("T_Sale_Type",conn));
            table.Add("hi");
            table.Add("Ok");
            comm.Parameters.Add("table", OracleDbType.Table).Value = table;
            comm.ExecuteNonQuery();
            conn.Close();

The Code Can't Work Always

Posted: Thu 02 Feb 2012 10:19
by jiayu821
First, thanks for you reply

but when i try you code in my program, i got the ora-03115 error on the line below:
OracleTable table = new OracleTable(OracleType.GetObjectType("T_Sale_Type", conn));

i used version 6.1 ,is the version's problem?

Posted: Thu 02 Feb 2012 14:56
by Pinturiccio
Yes, the snippet of code will work only with the latest version of dotConnect for Oracle (6.70.293), because the support for OBJECT, TABLE, VARRAY, REF, XMLTYPE data types in Direct mode was added in this version. For more information please refer to http://www.devart.com/dotconnect/oracle ... story.html
You can upgrade to the latest version or refuse to use direct mode. You can also download the Trial Edition of dotConnect for Oracle at http://www.devart.com/dotconnect/oracle/download.html and evaluate new features.