Tuesday, June 4, 2013

SQL Loader program in Shell Script

  1. Check the control file is present
  2. Check the data file present
  3. Check the data file size is zero or not
  4. Put dos2unix <filename> is used to remove newline character and control character , this is optional
  5. Load the data into custom table using sql loader
Syntax :
sqlldr “db_user/db_passwd” control="controlfile path".ctl log="logfilepath".log bad="badfile path".bad  data="data file path“
Example :

sqlldr ${FCP_LOGIN} control="controlfile.ctl" log="logfile.log" bad="badfile.bad"  data="datafile“

Note : bad file is created only data file having invalid data content

No comments:

Post a Comment

Item - Category Query

      SELECT      msi.segment1 AS Item_Code,       msi.DESCRIPTION AS Item_Desc,       mcs.CATEGORY_SET_NAME,       mck.CONCATENATED_SEGMEN...