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

Thread: I have another question about sqlldr:

  1. #1
    Join Date
    Jan 2001
    Posts
    515
    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


  2. #2
    Join Date
    Jan 2001
    Posts
    26
    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.

  3. #3
    Join Date
    Jan 2001
    Posts
    515

    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)


  4. #4
    Join Date
    Jan 2000
    Location
    Silver Spring MD USA
    Posts
    105
    What does the load file look like?

  5. #5
    Join Date
    Dec 2000
    Location
    Washington DC
    Posts
    42

    Thumbs up 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
  •  


Click Here to Expand Forum to Full Width