Page 1 of 1

Error Type "OracleDbType.Clob" cannot be used in PL/SQL tabl

Posted: Tue 26 Oct 2010 10:55
by amirela
How can i use "OracleDbType.Clob" type with PL/SQL table?
Error: "Type "OracleDbType.Clob" cannot be used in PL/SQL table parameter"

Posted: Wed 27 Oct 2010 16:29
by StanislavK
Could you please describe the scenario you are trying to perform in more details?

Do you mean passing a PL/SQL table of Oracle LOBs into a stored procedure? Provided that you have declared the corresponding table type (say, 'LOB_TABLETYPE'), this can be done in the following way:

Code: Select all

// Register the corresponding table type in your application
OracleType lobtabletype = OracleType.GetObjectType("LOB_TABLETYPE", oracleConnection1);
// Create the table
OracleTable table = new OracleTable(lobtabletype);

// Populate the table
...

// Add this table as a parameter to an OracleCommand object.
oracleCommand1.Parameters.Add(new OracleParameter("p0", OracleDbType.Table));
oracleCommand1.Parameters[0].Value = table;

// Execute the command.
...
Please tell us if this helps.