Launching SQL*Loader from within PL/SQL procedures
We have a requirement to automate a data load process that is currently being launched manually. I have been looking into several options including using the OCI to make a call to SQL*Loader. We are using Oracle 8i (8.1.7) on a SUN box (Solaris 5.8).
We are looking at having a process (possibly PL/SQL) check for the existance of the raw data file (a fixed length text file). If the file exists then the process would call SQL*Loader, with associated arguments, to load the file into the database. Upon success the process would then execute additional data validation and data manipulation batch processes that are written
in PL/SQL packages.
We are still investigating options but I was hoping someone else out there has done this. Any comments are welcome. How did you do it? What did you have to do to DB parameters and OS config to get it to work? What challenges did you have? etc.
David Le Gallez
IBM Business Consulting Services
If there is no other option (like using ext proc) u can use the host command to invoke sql loader to populate.
The easiest way to do such things is creating a shell-script in Unix,
that will check if a file exists and then start sql-loader.
The script can be scheduled in the CRONTAB.
Something like this:
# Start SQL loader
sqlldr userid=user/passwd \
rows=100000 >> $vLogFile
########### Here it starts ###########
for currtype in $filetypes
Ben de Boer
Click Here to Expand Forum to Full Width