Re: Unix command on PL/SQL
From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Fri, 5 Mar 1999 20:56:01 +0100
Message-ID: <36e036d2$0$5988_at_newton>
Date: Fri, 5 Mar 1999 20:56:01 +0100
Message-ID: <36e036d2$0$5988_at_newton>
Mark Gumbs wrote
>Issue a host command.
>
>host('mv ,login ,login2');
This is not part of the PL/SQL language, but a SQL*Plus command. So, you cannot use it inside a PL/SQL block, like:
begin
host('mv ,login ,login2');
end;
To issue host command from PL/SQL you need to send a command to a Unix daemon process using dbms_pipe. The Unix daemon process shoudl also connect to the database, for example using Pro*C pre-compiler. See your docs for examples.
Alternatively, you could put your Unix commands in a table, and schedule a Unix script to run every now and then. That script would take the lines from the table and simply execute them.
Arjan. Received on Fri Mar 05 1999 - 20:56:01 CET