I have a question about sqlldr:
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: I have a question about sqlldr:

  1. #1
    Join Date
    Jan 2001
    Posts
    515

    Lightbulb

    Do you have to specify every field on the table that you are loading? If you set column defaults in the table and you don't specify them in the sqlldr control file will that work?
    We have a file that only has info for about half of the columns in the table we are loading. So what we want to do is load those fields and default the other columns to NULL. The problem that we are having is that sqlldr doesn't like the fact that not all of the columns are specified. Any help would be appreciated.

  2. #2
    Join Date
    Dec 2000
    Posts
    75
    Base on my experience, you need to explicitely specify all fields. To save time, you can probably describe the table, then cut and paste to your script.
    goodhealth

  3. #3
    Join Date
    Nov 2000
    Location
    Charlotte
    Posts
    88
    How is your sqlldr control card setup? Are you looking at the load file by position or is it delimeted?

  4. #4
    Join Date
    Jan 2001
    Posts
    28
    I am not sure if you have got the answer you are looking for, but I have discovered this lately.
    I was loading a delimited file with n columns and i had to skip columns in between, like load column 1, 3, 10 and so on... to suffice this, there is an utility in sqlldr called FILLER, you can give any dummy name and just say FILLER.
    In case of a fixed file, just skip off those positions and columns in your CTL file. I hope I have answered your question.

  5. #5
    Join Date
    Jan 2000
    Location
    Silver Spring MD USA
    Posts
    105
    Just to add on the default value part, in my experience, SQL*Loader does not automatically put in default values into fields. You will need to use the DEFAULTIF parameter or use decode like:

    field1 "decode(:field1,'','default string',:field1)",

    This would work just like DECODE function. However this will not work with direct=y

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