Attempt to set a parameter name that does not occur in the SQL
avromSep 12 2009 — edited Oct 15 2014Hi all,
Apologies if this is a very basic question--I'm sort of learning the finer points of Oracle JDBC as I go here.
I have an OracleCallableStatement, stmt, constructed from the following String:
"BEGIN :PNFORFNRESULT := employees_pkg.get_emp_by_pk(:EmployeeId); employees_pkg.lock_emp(:EmployeeId);END;"
When I call
stmt.setObjectAtName(":EmployeeId", new NUMBER(101), OracleTypes.NUMBER);
I get a SQLException with the message,
"Attempt to set a parameter name that does not occur in the SQL: :EmployeeId"
passing in "EmployeeId" (without the colon; I couldn't figure out whether it was needed or not) makes no difference except for the number of colons in the error message.
Am I misunderstanding how setObjectAtName() is supposed to work? Or what sort of String can be used to create an OracleCallableStatement?
Thanks much,
Avrom