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

Thread: inserting into date column

  1. #1
    Join Date
    Jan 2001
    Posts
    157

    Smile

    I am trying to insert a date column into a table.
    The format from the file that the date is coming from is 021101,020901,080200,etc.
    How do I insert it?

    using this syntax "insert into table_name (date_column_name) values (to_date('02-02-02'));"
    does not seem to work. Any Idea how to make this insert work?

  2. #2
    Join Date
    Oct 2000
    Location
    Halifax, Nova Scotia
    Posts
    197
    I just tried this. I am not sure if it is what your looking for but it may be a start in the right direction

    select to_date('020202', 'YYMMDD') from dual;

    Result
    TO_DATE('
    ---------
    02-FEB-02

    to use to_date you give it the date string that you are receiving and also the format that the date string is in. In my case I was giving it Year month day so the format was 'YYMMDD'

    You can try to toss that into your insert and see what happens
    Don't be afraid to try something new. Amateurs built the Ark, professionals built the Titanic

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