Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2008
    Posts
    1

    Unanswered: error on sql loader

    I've a csv which I want to load in two oracle tables. I need to do do an insert into the cv_test table first and then into the cv_test_gmi.
    I'm having a problem with the IDXACCOUNT field in the cv_test_gmi table. I need to write a select statement there. How would I do that? I'm pasting what I've below. Please help.

    LOAD DATA
    INFILE 'C:\testACCOUNTS.csv'
    BADFILE 'C:\testACCOUNTS.bad'
    APPEND
    INTO TABLE cv_test FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
    (
    MARKET ,
    OWNERNAME ,
    NAME ,
    FGIVEUP "case when :fgiveup is null then 0
    else 1
    end",
    ACCOUNTTYPE "SUBSTR(:ACCOUNTTYPE,1,1)",
    CLAIR ,
    CLEARINGMEMBER ,
    CLEARINGINFO ,
    LINKS ,
    EXCHANGEDATA ":NAME",
    CLEARINGTYPEF CONSTANT 'O',
    CLEARINGTYPEO CONSTANT 'O',
    IDXACCOUNT "CV_SEQT.nextval"
    )
    INTO TABLE cv_test_gmi
    (
    FIRM CONSTANT 'M',
    OFFICE ,
    ACCOUNT ,
    IDXACCOUNT "select idxaccount from cv_test where name= ":NAME" AND MARKET='MARKET'"
    )

    I'm getting the below pasted error when I try to run it.
    SQL*Loader-350: Syntax error at line 29.
    Expecting valid column specification, "," or ")", found ":".
    IDXACCOUNT "select idxaccount from cv_test where name= ":NAME"

  2. #2
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    Don't put double quotes around :NAME, use single quotes if you are comparing a string... so it should look like this:

    IDXACCOUNT "select idxaccount from cv_test where name= ':NAME' AND MARKET='MARKET'"
    JoeB
    save disk space, use smaller fonts

Posting Permissions

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