SQL Loader with dynamic control file generation
Hi All, Now what i am writing, I believe many of new bees will require it while using sqlldr for ETL or any other data loading issue. The thing is while loading using sqlldr there is no option to enter the source file name in that table. So what I have done I just create a dynamic control file which generates before loading of each source file. Here I have used two scripts 1) proc1: for filtering files and running a loop. Every source file will be processed in this loop. 2) another procedure proc2 which is called by proc1 to perform load operation proc1 ------- while (( $i < $filecounter )); do echo "file number $i" ### Take the first File FILENAME=`ls -l *.txt|head -1|awk -F' ' '{print $9}'` dos2unix $FILENAME ### if filename exists already continue the loop ### FINDSQLSCRIPT="select 'COUNT:'||count(*) from TBLBRACSUMMARY where file_name='$FILENAME';" OUTPUT_FILECOUNT=`/app/u01/oracle/prod...