DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: pl/sql: select into date is wrong format

  1. #1
    Join Date
    Sep 2007
    Posts
    1

    pl/sql: select into date is wrong format

    I have a column defined as date with values such as 1/1/2007. If I select that column INTO a local date var, it becomes 1/1/07.

    I also tried selecting it into a varchar2 column and using to_date(var,'mm/dd/yyyy') but that also yielded 1/1/07.

    If I do a plain select (outside pl/sql) the column will display as 1/1/2007.

    How can I force the local var to be mm/dd/yyyy? thanks!

    Steve

  2. #2
    Join Date
    Sep 2007
    Posts
    36
    If it's a DATE, it's a date. It's right, Oracle understands it, don't worry about how it appears to YOU, it's not a varchar. If you are not seeing it right you may want to format it with TO_CHAR, rather than TO_DATE.

    If this is too annoying take a look at NLS_DATE_FORMAT in your init files.

    J
    Last edited by jay_l_a; 09-19-2007 at 04:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width