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

Thread: Dates & Times Loaded into table via SQL Loader

  1. #1
    Join Date
    May 2000
    Location
    Toronto, Ontario, Canada
    Posts
    2

    Exclamation

    I am trying to load a table with a date field. But the date field contains a timestamp as well. Des any on know how it can be done. The data looks like the following:

    2000/10/2306.58.39 006927279736
    2000/10/2306.58.41 002947001037
    2000/10/2306.59.01 004857213433
    2000/10/2306.59.16 002940435236
    2000/10/2306.59.22 008630556335

    Position (1:10) CALL_DATE
    Position (11:18) CALL TIME
    Position (19:41) ACCOUNT_ID


    I need to load the date & time because calculation need to be done between times (i.e. calculated duration between calls, etc).
    How would I create the Table schema. Would the Date be combine with Call Date & Time???


    Can anyone help!!!!

  2. #2
    Join Date
    Oct 2000
    Posts
    90
    If you had the file in you control file, it could be something like this. I haven't tested this, but it should give you an idea of what to do.

    LOAD DATA
    INFILE *
    INTO TABLE your_table
    (call_date POSITION (1:18) "TO_DATE(:call_date, 'YYYY/MM/DDHH.MI.SS')",
    account_id POSITION(19:41) )
    BEGINDATA
    2000/10/2306.58.39 006927279736
    2000/10/2306.58.41 002947001037
    2000/10/2306.59.01 004857213433
    2000/10/2306.59.16 002940435236
    2000/10/2306.59.22 008630556335
    ...
    ...
    ...

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