-
When loading the datafile through sqlldr can I add values in the control file? For example:
into table abc(
col1 position(01:05) char,
col2 I want to enter my own value here(NULLS or literals),
col3 position (06:08) char)
Is that possible?
sample file:
aaaaawww
table results:
col1 col2 col3
aaaaa NULLs or literals www
-
Yes. You can do it. Actually you could move col2 after col3 to make more sense of the control file.
While inserting literals or NULLS in any of the columns, you may have to enclose the values in double quotes. For eg:
col2 "Junk text"
Try it.
Happy coding.
-
It's not working
I tried to insert a null and the following happened:
QL*Loader-350: Syntax error at line 6.
Expecting valid column specification, "," or ")", found "NULL".
col3 NULL)
^
My control file looks like this:
LOAD DATA
INFILE 'sqltestload.DAT'
into table abc
(col1 position (01) char,
col2 position (02:06) char,
col3 NULL)
-
What does the load file look like?
-
Dude Try This
Use the word CONSTANT followed by some test in single quotes.....
LOAD DATA
INFILE '..\data\WebUnsubList.txt'
BADFILE '..\bad\WebUnsubList.bad'
APPEND INTO TABLE unsub_subscriber
FIELDS TERMINATED BY ',' TRAILING NULLCOLS
(
EMAIL CHAR,
ORIG_FILE CONSTANT 'WebUnsubList'
)
Ken Hinerman
Data Interaction
DBASupport@datainteraction.com
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
|