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

Thread: sql loader control file question

  1. #1
    Join Date
    Jan 2001
    Posts
    63

    sql loader control file question

    I have been looking through the SQL*Loader documentation this afternoon, but haven't found what I need.
    In my control file, I am loading a char. field that if it is blank or null, I want to load it as "0".

    I don't see where NULLIF or DEFAULTIF help me with this. Can some one tell me how to do it?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    use decode such as

    decode(:filed_a, null, '0', :field_a)

    however defaultif does what you want as well, you may need to use preserve blanks, defaultif sets non-numeric to NULL and numeric to 0 if the condition is satisfied

    http://download-west.oracle.com/docs...06.htm#1007544

  3. #3
    Join Date
    Jan 2001
    Posts
    63
    I would like to be able to use the decode function, but this is what I got when I tried it:

    SQL*Loader: Release 8.0.5.0.0 - Production on Fri Sep 3 15:8:54 2004

    (c) Copyright 1998 Oracle Corporation. All rights reserved.

    SQL*Loader-350: Syntax error at line 7.
    Expecting "," or ")", found "(".
    decode(:METER_NBR, NULL, '0', :METER_NBR),
    ^

    C:\orant\BIN>

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