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

Thread: Date with timestamp

  1. #1
    Join Date
    Sep 2002
    Posts
    376

    Date with timestamp

    I am populating a date column into a table, from a flat file say... 07/28/2010

    But when i insert this into table, it is inserted as 07/28/2010 00:00:00

    I want to track the time the record was inserted into TABLE. I know that it can be done with one more column as timestamp and map it with this inserted date.

    Just wondering, If there is any other way I can handle this without one more column.

    (I cannot modify the flat file as it is coming from other source )
    ------------------------------------------------------------------------
    The most enjoyable things in the world are either Immoral or too Expensive or otherwise Inaccessible anyway

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Quote Originally Posted by bang_dba View Post
    I am populating a date column into a table, from a flat file say... 07/28/2010

    But when i insert this into table, it is inserted as 07/28/2010 00:00:00
    Not sure why you use the word "but" - Oracle is doing exactly what it is supposed to do when populating a date datatype column with a plain date.


    Quote Originally Posted by bang_dba View Post
    I want to track the time the record was inserted into TABLE. I know that it can be done with one more column as timestamp and map it with this inserted date.

    Just wondering, If there is any other way I can handle this without one more column.
    This is more of a data modeling issue.
    Is the original "date column" supposed to be the one tracking insert time or is it supposed to show the date that comes from the original source?

    If column is supposed to track insert time I would suggest to populate this column with sysdate instead of using the date that comes from original source.

    If column is supposed to show the date that comes from original datasource and you also need to track insert time you have to add a timestamp column and populate it accordingly.

    Hope this helps.
    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.

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