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

Thread: Sqlloader Question

  1. #1
    Join Date
    Jan 2001
    Posts
    515

    Sqlloader Question

    I have the following as a control file

    load data
    infile '/mydir/MY_TRANS_20050915.DAT'
    into table MY_TRANS
    when (1) <> "TR"
    fields terminated by '|'
    trailing nullcols
    (
    FWT_ACCT_NO,
    FWT_VALUE_DT DATE "YYYYMMDD",
    FWT_POST_DT DATE "YYYYMMDD",
    FWT_CONV_TRAN_AMT,
    FWT_CONV_CASH_AMT ,
    )

    The fwt_conv_cash_amt is coming in the file as empty. How do I tell sqlloader if it is empty put a zero in there?

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    How about applying a SQL function?

    Examples: http://oraclesvca2.oracle.com/docs/c...06.htm#1012832
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,441

    Cool


    If you look closely in the manual from slimdave's link, you may note that by using the DEFAULTIF clause, the field is set to 0 if the field in the datafile is a numeric field and this clause is satisfied.

    Example:

    FWT_CONV_CASH_AMT DECIMAL EXTERNAL DEFAULTIF FWT_CONV_CASH_AMT = BLANKS,


    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

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