How to set nls_timestamp_format per procedure call

rusty111

New Member
I have a stored procedure that will insert into an xmltype column. The column refers to a schema with a column of datetime type. The date needs to be formatted like so : YYYY-MM-DD"T"HH24:MI:SSTesting it via anonymous block, I can issue an ALTER SESSION to change the time format to the current session\[code\]alter session set nls_timestamp_format = 'YYYY-MM-DD"T"HH24:MI:SS';insert into table1 (id, xmlcolumn) values (1, updatexml( '/root/order/id/text()', p_order_id, '/root/order/date/text()', to_timestamp(sysdate,'DD-MON-RRRRHH:MI:SS.FF')));\[/code\]Moving this to stored proc though, Oracle prevents me from using the ALTER SESSION, I tried: \[code\]DBMS_SESSION.SET_NLS('nls_timestamp_format','YYYY-MM-DD"T"HH24:MI:SS');\[/code\]but SQL Developer says invalid option. I'm very new to Oracle (being a SQL DB Dev),any pointers on how to set the time format? Thanks in advance
 
Back
Top