System.Data.OracleClient.OracleException: ORA-01036: illegal variable name/number
Is anyone familiar with this error?
System.Data.OracleClient.OracleException: ORA-01036: illegal variable name/number
I get it when calling oracle stored procedures
Here is a sample of my code:
m_oracleCommand[0].CommandType = System.Data.CommandType.StoredProcedure;
for (int i = 0; i < this.DbParamsCollection.Count; i++)
{
p = (FocusDbParameter)this.DbParamsCollection
;
m_oracleCommand[0].Parameters.Add(":" + p.ParameterName, p.Value).Direction = System.Data.ParameterDirection.Input;
m_oracleCommand[0].Parameters
.Size = p.Value.ToString().Length;
}
m_oracleCommand[0].CommandText = "FOCUS_RPT.FOCUS_RPT_B3";
m_oracleCommand[0].Connection = m_arrOracleConn[0];
Thanks,
Doug
This kind of problem i encountered 4 to 5 times and everytime i found a different problem. Most of the time the underlying problem is with paramaters.
Check following when you get this error.
1. parameter name which you are setting and which you are passing in the insert, update and delete commands.
2. Values : If you try to pass string to a number datatype.
3. Null Values. Null values has to be handled seperately for Delete and update
Example : (ColumnName = :pColumn_Name OR :pColumn_Name IS NULL AND ColumnName IS NULL);
4. Datatypes of hose columns in Oracle table with the Datatable columns
5. Check spaces in the parameter name.
I hope above tips may help you in resolving the problem.
Looks like you have to clear your parameters right before creating the first one.
You have to also clear your parameter right after any execution.
user this command and see if it works:
cmd.Parameters.Clear()
good luck.