Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Call "host" from trigger ...

Re: Call "host" from trigger ...

From: OracleMS <lostpwds_at_hotmail.com>
Date: 20 Jul 2001 06:08:50 -0700
Message-ID: <17742ed1.0107200508.34620f34@posting.google.com>

Hi,

"host" is a SQL*Plus command. It will not work in PL/SQL. You will have to write a small C program that accepts arguments and executes them at the operating system level as a command, register that as a "type" in your database, write a PL/SQL wrapper for calling the C program as an external procedure and then use that procedure in your trigger. It works on UNIX, but after looking at your host command - dir, I am thinking that you are on NT. I guess you can use Pro*C.

Murali Sreedhar

kant.hung_at_everypath.com (Kant Hung) wrote in message news:<1dbe22ab.0107191328.3f816b7b_at_posting.google.com>...
> Hi all,
>
> Sorry, I am still learning Oracle ...
>
> All I want to do here is to execute a host command "dir" in this case
> when this trigger is activated ... it keep asking me to define "host".
> Should "host" be already define in Oracle? Please help if you don't
> mind. Thank you.
>
> Kant Hung
> kant.hung_at_everypath.com
>
> ------------------------------------------------------------------------------
> DROP PROCEDURE pay_salary2;
>
> CREATE OR REPLACE PROCEDURE pay_salary2 (
> sal float, fica float, sttax float, ss_pct float, espp_pct float)
> is
> BEGIN
> host ('dir');
> END;
> /
>
> DROP TRIGGER Project_changes2;
> CREATE OR REPLACE TRIGGER Project_changes2 AFTER DELETE OR UPDATE OR
> INSERT ON Project_tab
> FOR EACH ROW
> CALL pay_salary2(6000.00, 0.2, 0.0565, 0.0606, 0.1)
>
> /
Received on Fri Jul 20 2001 - 08:08:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US