Extract a full timestamp (date included) from a Select query; Oracle

后端 未结 3 840
[愿得一人]
[愿得一人] 2021-01-16 18:28

So I am trying to insert multiples rows of data from one table to another. I have done this; however, I am having an issue with some of my columns, specifically my date colu

3条回答
  •  天命终不由人
    2021-01-16 19:20

    Two options:

    1) If you have alter session privilege, change the NLS_DATE_FORMAT before running the SELECT statement as given below:

    ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-RR HH24:MI';
    

    2) If you don't have ALTER session privilege then apply the transformation for each date field as given below (the stmnt below shows it for START_POUR)

    'TO_DATE(''' || TO_CHAR(START_POUR, 'DD-MON-RR HH24:MI') || ''', ''DD-MON-RR HH24:MI'')'
    

提交回复
热议问题