Click to See Complete Forum and Search --> : How can I invoke OS statements from a stored procedure?


MetomEnTodo
09-19-2003, 09:50 AM
Hello,

our system has to import CSV data once a night automatically using SQL*Loader. Afterwards these date has to be analyzed.

The first I though to have 2 daemons, a first one running on the DB host who starts SQL*Loader, and a second one running in a different application host who starts the analyzer application. But in this way I can't synchronize both daemons to start the 2nd when the 1st finishes.

Indeed I wish the analizer daemon self started SQL*Loader, thus having only one daemon on the application host, which calls a Stored Procedure who starts SQL*Loader. But I don't know how to.

How can I invoke OS statements from a stored procedure?

Many thanks in advance

TimHall
09-19-2003, 11:47 AM
Hi.

This might help:

http://www.oracle-base.com/Articles/8i/ShellCommandsFromPLSQL.asp

Cheers

Tim...

MetomEnTodo
10-08-2003, 11:06 AM
Hi Tim,

many thanks for your help.

At last we decide to start the process from a main shell script, which is also the most reasonable, who gets the CSV files via FTP, then runs SQL*Loader, and at last runs the PHP-aplication to analiuze the imported data.

We can't use External Tables since we still use Oracle 8.1.7, but that's good to know. I work with 9i in other projects.

The matter came out because we develop on MySQL 4.x, then we'll migrate the DB to Oracle 8.1.7 . MySQL accepts statements similar to the content of a SQL*Loader control file, as if they were SQL statements, being sent from a PHP-application. This does not work with Oracle.