ORA-01008: not all variables bound ,What's wrong ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is my code
OracleConnection OraCN = new OracleConnection(conStr)
OracleCommand OraCM = new OracleCommand("insert into CONTENT values ( :subxml ) ",OraCN)
OraCM.CommandType = CommandType.Text
OraCM.Parameters.Add("subxml",OracleType.Clob,submitXml.Length,submitXml)
OraCN.Open()
OraCM.ExecuteNonQuery()

I got the error :ORA-01008,what's wrong with the code,thanks
 
A.R.

When referencing a bind variable using named notation, you must use the :
identifier as a part of the parameter name in both the command text and the
parameter factory. Have a look at the ODP.Net documentation, especially
page 4-80 for an example.

Positional notation is based on the numeric parameter reference and the
corresponding position of the parameter in the collection, in which case the
: identifier is not required when creating the parameter object.

Try something like this:
....
OracleCommand OraCM = new OracleCommand("insert into CONTENT values (
:subxml ) ",OraCN);
....
OraCM.Parameters.Add(":subxml",OracleType.Clob,submitXml.Length,submitXml);


regards
roy fine
 
Back
Top