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)
Can i Pass String Array to Procedure
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
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
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?
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?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
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.
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.