Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    2

    Unanswered: SQL*Loader - Selective data load based on SYSDATE

    I'm a sqlldr newbie and am trying to update some automated loading code. I have a text file which is uploaded to a table in the database using sqlldr. positions (1:6) in the file are a date field in "YYMMDD" format. I don't want to load any lines where the date field is equal to today.

    It would seem to me that the following should work (but it doesn't). What am I missing?

    Load Data
    Replace
    into table my_data
    WHEN (1:6) != TO_CHAR(TRUNC(SYSDATE), 'YYMMDD')
    (
    GREETING CONSTANT 'HI_MOM',
    IMPL_DATE POSITION(1:6) DATE "YYMMDD"
    )

    This isn't a life and death. We are dumping to a temporary table, so I can filter at that point, where I am more comfortable with the code. However, I would like to know if this filtering possible with sqlldr?

  2. #2
    Join Date
    May 2006
    Posts
    132
    What version of Oracle are you running?

    If you are on 9i or above, you may want to consider external tables. Since you are loading the file into a temp table already, an external table could work wonders for you.

  3. #3
    Join Date
    Jul 2006
    Posts
    2

    Yep, we're 9i!

    Yes, we're running 9i. I'll start researching External Tables.

    Thanks for the tip!

    Rob

Posting Permissions

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