I want to set an oracle package variable from my java app, but I'm having trouble figuring out to code. I have this package:
CREATE OR REPLACE PACKAGE vars AS
userId varchar2(15);
END;
/
I want to set this userId like this from my java app:
begin vars.userId := <userid>; end;
I've trid the following code:
try {
CallableStatement stmt =
conn.prepareCall ("{call begin vars.userId := 'testuser'; end;}"
stmt.execute ();
} catch (Exception e){
System.out.println(e.toString());
}
but I get the following exception:
java.sql.SQLException: ORA-01400: cannot insert NULL into ("NOTE"."NOTE_AUDIT"."CHANGED_BY" ORA-06512: at "NOTE.LOGNOTECHANGES", line 21 ORA-04088: error during execution of trigger 'NOTE.LOGNOTECHANGES'
Any ideas on how I need to code this? Thanks
CREATE OR REPLACE PACKAGE vars AS
userId varchar2(15);
END;
/
I want to set this userId like this from my java app:
begin vars.userId := <userid>; end;
I've trid the following code:
try {
CallableStatement stmt =
conn.prepareCall ("{call begin vars.userId := 'testuser'; end;}"
stmt.execute ();
} catch (Exception e){
System.out.println(e.toString());
}
but I get the following exception:
java.sql.SQLException: ORA-01400: cannot insert NULL into ("NOTE"."NOTE_AUDIT"."CHANGED_BY" ORA-06512: at "NOTE.LOGNOTECHANGES", line 21 ORA-04088: error during execution of trigger 'NOTE.LOGNOTECHANGES'
Any ideas on how I need to code this? Thanks