-
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.
-
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
-
How is your sqlldr control card setup? Are you looking at the load file by position or is it delimeted?
-
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|