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:SS
Testing it via anonymous block, I can issue an ALTER SESSION to change the time format to the current session
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')
));
Moving this to stored proc though, Oracle prevents me from using the ALTER SESSION, I tried:
DBMS_SESSION.SET_NLS('nls_timestamp_format','YYYY-MM-DD"T"HH24:MI:SS');
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