title: How to set nls_timestamp_format per procedure call
body: <p>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</p>
  
  <p>Testing it via anonymous block, I can issue an ALTER SESSION to change the time format to the current session</p>
  
  <pre><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></pre>
  
  <p>Moving this to stored proc though, Oracle prevents me from using the ALTER SESSION, I tried: </p>
  
  <pre><code>DBMS_SESSION.SET_NLS('nls_timestamp_format','YYYY-MM-DD"T"HH24:MI:SS');
  </code></pre>
  
  <p>but SQL Developer says invalid option. </p>
  
  <p>I'm very new to Oracle (being a SQL DB Dev),any pointers on how to set the time format? </p>
  
  <p>Thanks in advance</p>