Page 1 of 1

ORA-01036 illegal variable name/number in 5.25.39.0

Posted: Thu 28 Jan 2010 07:08
by quangnd
I have this error when run this code:

string sql = "select * from customer_profile where profile_id = :1";
OracleCommand oraCursorCommand = new OracleCommand(sql, conn);
oraCursorCommand.CommandType = CommandType.Text;
oraCursorCommand.Parameters.Add("p1", OracleDbType.Long).Value = 68;

Why? I do not have this error while using ODP.Net!

Posted: Thu 28 Jan 2010 12:24
by StanislavK
Please try adding the parameter as follows:

Code: Select all

oraCursorCommand.Parameters.Add("1", OracleDbType.Long).Value = 68;
In dotConnect for Oracle, the names of the OracleParameter instances added to the command should correspond to the parameter names used in the query. Please see the "Using Parameters" topic of our help:
http://www.devart.com/dotconnect/oracle ... eters.html