oracle - Issue while checking data before loading in sql data loader -


i using following code excerpt while loading data in oracle db using sql loader:

    "tran_code position(238:239)," + "frm_acct position(247:265) \"to_number(:frm_acct)\" nullif :frm_acct='*******************'," + "to_acct position(269:287)," + 

it giving error on null if guess issue clear want insert null when data contains asterisk otherwise convert number , insert.

thanx in advance.

you can try -

"decode(:your_col,'***************',null,to_number(:your_col))" 

however, suggest better option in scenarios "external table". here's link reference :- http://docs.oracle.com/cd/b19306_01/server.102/b14215/et_concepts.htm


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -