Re: OS Command from PL/SQL

From: Gert Rijs <gem_at_wirehub.nl>
Date: 1996/12/24
Message-ID: <01bbf1be$e8b6e080$525fa5c2_at_gertrijs>#1/1


Hi,
[Quoted] From a sql*plus script or forms it is simple (using the host command), perhaps using a remote-shell (rsh) to run it on another machine.

If you can live with a delay:
- Insert the sql*load command in a table (say HOST_COMMANDS). - Schedule a sql*plus script to run every hour (or minute) using cron (unix).

  s*p: set heading off                                      <- no headers
printed please
         set pagesize 0
         spool cmds.sh                                       <- output goes
to this file
         select command from host_commands;   <- select the Sql*Load
command
         spool off                                               <- stop
'ecording'
         delete from host_commands;                  <- cleanup
         commit;
         !cmds.sh                                               <- run the
sql*load command
         exit

[Quoted] Another way to do it is using the dbms_pipe package to 'send' the sql*load command to a daemon program that listens to the dbms_pipe. I believe there is a sample daemon program in one of the Pro*C or oci manuals (check them).

Hope this helps,

        Gert

-- 
At Home: gem_at_wirehub.nl
At Work: gert.rijs_at_corp.ah.nl

Jeremy Wong <jewong_at_po.pacific.net.sg> wrote in article
<01bbf17c$1c6461c0$5a5478cb_at_jewong>...

> Has anyone found a way to issue an OS command from PL/SQL? I'm trying to
> run SQL*LOADER from a procedure. I'm using Oracle 7.2 and the operating
> system is Windows NT3.51.
>
> Thanks,
> Jeremy
>
Received on Tue Dec 24 1996 - 00:00:00 CET

Original text of this message