R
Ron Jacobs
I am having trouble using an oracle parameter in a simple
sql statement. I am able to get this sort of thing to
work in SQL Server with no problem...
Here is my code for oracle:
OracleConnection conn = new
OracleConnection(strConnection);
conn.Open();
string strCommand = "Insert into RonTable
(STRCOL) VALUES (STRCOL)";
string strValue = "Here is the value from
TestParameterCommands";
OracleCommand insCmd = new OracleCommand
(strCommand,conn);
OracleParameter op = new OracleParameter
("STRCOL",OracleType.VarChar,100);
op.Value = strValue;
insCmd.Parameters.Add(op);
int iRows = insCmd.ExecuteNonQuery();
When the command is executed, I get an exception whose
message reads: "ORA-01036: illegal variable name/number"
I have tried various names for the parameter to no avail.
Any Ideas??
I should note that I have no problem calling a stored
procedure on Oracle, just a Parameterized sql statement!
Thanks in advance,
Ron
sql statement. I am able to get this sort of thing to
work in SQL Server with no problem...
Here is my code for oracle:
OracleConnection conn = new
OracleConnection(strConnection);
conn.Open();
string strCommand = "Insert into RonTable
(STRCOL) VALUES (STRCOL)";
string strValue = "Here is the value from
TestParameterCommands";
OracleCommand insCmd = new OracleCommand
(strCommand,conn);
OracleParameter op = new OracleParameter
("STRCOL",OracleType.VarChar,100);
op.Value = strValue;
insCmd.Parameters.Add(op);
int iRows = insCmd.ExecuteNonQuery();
When the command is executed, I get an exception whose
message reads: "ORA-01036: illegal variable name/number"
I have tried various names for the parameter to no avail.
Any Ideas??
I should note that I have no problem calling a stored
procedure on Oracle, just a Parameterized sql statement!
Thanks in advance,
Ron