sqlldr username@server/password control=loader.ctl
sqlldr username/password@server control=loader.ctl
Objective of this blog is to share my oracle knowledge with the people who are working in oracle.
LOAD DATA insert into table sv_temp fields terminated by '|' optionally enclosed by '"' (first_col ,second_col )
cd $CUSTOM_TOP/data for file in sample*.dat do sqlldr userid=$login control=$CUSTOM_TOP/bin/sv_test.ctl data=$CUSTOM_TOP/data/$file mv $CUSTOM_TOP/data/$file $CUSTOM_TOP/archive/$file done
SQL*Loader: Release 8.0.6.3.0 - Production on Fri Mar 5 13:24:18 2010 (c) Copyright 1999 Oracle Corporation. All rights reserved. Commit point reached - logical record count 8 Commit point reached - logical record count 9 SQL*Loader: Release 8.0.6.3.0 - Production on Fri Mar 5 13:24:18 2010 (c) Copyright 1999 Oracle Corporation. All rights reserved. Commit point reached - logical record count 4 Commit point reached - logical record count 5 SQL*Loader: Release 8.0.6.3.0 - Production on Fri Mar 5 13:24:18 2010 (c) Copyright 1999 Oracle Corporation. All rights reserved. Commit point reached - logical record count 7
OPTIONS (SKIP=1) LOAD DATA infile '%1' APPEND INTO TABLE sv_test_tbl FIELDS TERMINATED BY "," optionally enclosed by '"' ( item_number "trim(:item_number)" , description "trim(:description)" , attribute1 "trim(:attribute1)" , process_flag Constant 'UNPROCESSED' )
OPTIONS (SKIP=1, LOAD=10, ERRORS=5)
LOAD DATA infile c:/sv_test.dat
REPLACE INTO TABLE sv_test_sql_tbl
FIELDS TERMINATED BY "," optionally enclosed by '"'
trailing nullcols
(
item_number "trim(:item_number)"
, vendor_name "trim(:vendor_name)"
, vendor_site_name "trim(:vendor_site_name)"
, supplier_item "trim(:supplier_item)"
, process_flag Constant 'UNPROCESSED'
)
sqlldr control='sv_test.ctl' data='sv_test.dat' load=10 errors=5 skip=1
LOAD DATA APPEND INTO TABLE sv_test FIELDS TERMINATED BY '|' TRAILING NULLCOLS ( long_text_columns char(40000) )
LOAD DATA APPEND INTO TABLE sv_test FIELDS TERMINATED BY '|' TRAILING NULLCOLS ( long_text_columns char(40000) --- first 40000 characters , column1 "trim(:column1)" --- Trims and loads , column2 "replace(:column2,'\n',chr(10))" --- replace \n with new line , column3 DATE "DD-MON-YYYY" --- defining date style , column4 "upper(:column4)" --- changing to upper case , column5 "lower(:column5)" --- changing to lower case , column6 constant "FIXED" --- assigning a constant value , column7 "sv_sequence.nextval" --- defaulting a value from sequence )
LOAD DATA APPEND INTO TABLE sv_test FIELDS TERMINATED BY '|' TRAILING NULLCOLS ( long_text_columns char(40000) )
LOAD DATA APPEND INTO TABLE sv_test FIELDS TERMINATED BY '|' TRAILING NULLCOLS ( long_text_columns char(40000) --- first 40000 characters , column1 "trim(:column1)" --- Trims and loads , column2 "replace(:column2,'\n',chr(10))" --- replace \n with new line , column3 DATE "DD-MON-YYYY" --- defining date style , column4 "upper(:column4)" --- changing to upper case , column5 "lower(:column5)" --- changing to lower case , column6 constant "FIXED" --- assigning a constant value , column7 "sv_sequence.nextval" --- defaulting a value from sequence )