Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010
    Posts
    1

    Unanswered: Decode Not working

    I had a requirement of loading flatfile into staging table using SQL Loader, One of the columns in the the Flat file is having values FALSE or TRUE and my requirement is that I load 0 for FALSE and 1 for TRUE which can be achieved by simple DECODE function...I did use decode and tried to load several times but did not work. What might be the problem
    LOAD DATA
    INFILE 'sql_4ODS.txt'
    BADFILE 'SQL_4ODS.badtxt'
    APPEND
    INTO TABLE members
    FIELDS TERMINATED BY "|"
    ( Person_ID
    FNAME,
    LNAME,
    Contact,
    status "decode(:staus, 'TRUE', '1','FALSE','0')"
    )
    I did try putting a trim as well as SUBSTR but did not work....the cloumn just doent get any values in the output (just null or say free space)
    Any help would be great.....

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Problem exists between Keyboard and chair.
    1) missing comma after "Person_ID"
    2) ":staus" should be ":status"
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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