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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Trigger

Re: Oracle Trigger

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 03 Feb 2004 10:42:37 -0800
Message-ID: <1075833699.286945@yasure>


Rajesh Patel wrote:
> I had a sql file that just had Creates for
> tables/views. Then I tried to add a trigger.
>
> I was using a jdbc connection to send the sql
> file to the database. That worked great until
> I added the trigger. I kept getting errors from
> oracle.
>
> So I used to SQL Plus to run in the sql file,
> everything worked fine.
>
> So I have concluded that inorder to run in a trigger
> or any PL/SQL code I need to use SQL plus to
> send it to the database.
>
> Am I correct?
>
> Raj

Your conclusion is incorrect but your solution is correct.

DDL to create a trigger requires the use of dynamic SQL. Using the DBMS_SQL package, or native dynamic SQL, you can easily build tables, views, triggers, packages, etc.

On the practical side it is a terrible practice to ever build objects using a JDBC connection from what, I presume, is a front-end. Build objects in SQL*Plus ... they are not transactional ... they are permanent parts of the schema and should be treated as such.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Feb 03 2004 - 12:42:37 CST

Original text of this message

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