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: Mark C. Stock <mcstockX_at_Xenquery>
Date: Tue, 3 Feb 2004 14:29:40 -0500
Message-ID: <eomdne9KIr1Qa4LdRVn-gw@comcast.com>

"Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message news:1075833699.286945_at_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)
|

Daniel,

Can you elaborate on why the generalization that dynamic SQL is required for creating triggers?

Received on Tue Feb 03 2004 - 13:29:40 CST

Original text of this message

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