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

Thread: Truncate time using SQL Loader

  1. #1
    Join Date
    Oct 2008
    Posts
    7

    Truncate time using SQL Loader

    Hi,
    I have a date field in my data file containing date + time, like, 2002-12-24 08:54:40.29.

    I need to insert this field in 'MM/DD/YYYY' format in the table using SQL Loader. Is there a way to truncate the time?

    Can anyone please suggest an option to do so at the earliest as this is urgent!

    Thanks.
    Last edited by shivam; 10-01-2008 at 06:25 AM.

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    You can include to_char() function in your SQL*Loader list of columns, lke...

    MyColumn EXPRESSION "to_char(MyDate, 'mm/dd/yyyy')"
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Oct 2008
    Posts
    7
    Thanks!

    I tried one more option which worked for me -
    MyColumn "To_date(substr(:MyColumn,1,10),'YYYY-MM-DD')"

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