Oracle message, error that makes no sense
-
I have a stored procedure in oracle that looks like this:
PROCEDURE validate_master_account_id (v_master_account_id IN NUMBER, v_is_valid OUT NUMBER);
And a procedure that looks like this:public static bool TestProcedure() { string procedureName = "SMT.CPR_MASTER_ACCOUNT_PKG.validate_master_account_id"; using (OracleConnection connection = new OracleConnection(AppSettings.ConnectionString)) { connection.Open(); using (OracleCommand command = new OracleCommand(procedureName, connection)) { command.Parameters.Add("v_master_account_id", OracleType.Number).Value = 16793; command.Parameters.Add("v_is_valid", OracleType.Number).Direction = ParameterDirection.Output; command.ExecuteNonQuery(); bool result = ((int) command.Parameters["v_is_valid"].Value) == 1; return result; } } }
I get an error message that says "ORA-01036: illegal variable name/number" and I can't figure out why? Thanks in advance. -
I have a stored procedure in oracle that looks like this:
PROCEDURE validate_master_account_id (v_master_account_id IN NUMBER, v_is_valid OUT NUMBER);
And a procedure that looks like this:public static bool TestProcedure() { string procedureName = "SMT.CPR_MASTER_ACCOUNT_PKG.validate_master_account_id"; using (OracleConnection connection = new OracleConnection(AppSettings.ConnectionString)) { connection.Open(); using (OracleCommand command = new OracleCommand(procedureName, connection)) { command.Parameters.Add("v_master_account_id", OracleType.Number).Value = 16793; command.Parameters.Add("v_is_valid", OracleType.Number).Direction = ParameterDirection.Output; command.ExecuteNonQuery(); bool result = ((int) command.Parameters["v_is_valid"].Value) == 1; return result; } } }
I get an error message that says "ORA-01036: illegal variable name/number" and I can't figure out why? Thanks in advance. -
I have a stored procedure in oracle that looks like this:
PROCEDURE validate_master_account_id (v_master_account_id IN NUMBER, v_is_valid OUT NUMBER);
And a procedure that looks like this:public static bool TestProcedure() { string procedureName = "SMT.CPR_MASTER_ACCOUNT_PKG.validate_master_account_id"; using (OracleConnection connection = new OracleConnection(AppSettings.ConnectionString)) { connection.Open(); using (OracleCommand command = new OracleCommand(procedureName, connection)) { command.Parameters.Add("v_master_account_id", OracleType.Number).Value = 16793; command.Parameters.Add("v_is_valid", OracleType.Number).Direction = ParameterDirection.Output; command.ExecuteNonQuery(); bool result = ((int) command.Parameters["v_is_valid"].Value) == 1; return result; } } }
I get an error message that says "ORA-01036: illegal variable name/number" and I can't figure out why? Thanks in advance. -
Remember the error is coming from Oracle, not from C#. Set the commandtype to stored procedure.
Yeah, that did it, thank you.