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: INSERT trigger question..

Re: INSERT trigger question..

From: Scott Baxter <sbaxter_at_c031.aone.net.au>
Date: Tue, 19 Dec 2000 22:19:50 +1100
Message-ID: <gpH%5.4944$%v1.166112@ozemail.com.au>

Hi Chuck,

the best way to do this would be, as you suggest, via an insert trigger.

The problem with using the application only to populate this column is that it will
not get populated if you insert a record outside of the application.

With a trigger you can insert a record in, Sql*plus, for example, and still have your insert succeed.

regards,



Heidi Thorpe
Senior Oracle DBA
Publications:
 Oracle8i Tuning and Administration: The Essential Reference.  Addison-Wesley (c) 2001.
 http://204.179.152.61/book/0,3828,0201704366,00.html Find it on Amazon:

http://www.amazon.com/exec/obidos/ASIN/0201704366/qid%3D974884865/sr%3D1-1/1 05-6952931-4572757


Chuck Carson <ccarson_at_ebuilt.com> wrote in message news:3a3e70bf.350645211_at_news.concentric.net...
>
> I am trying to determine if the proper method of doing this would be
> an insert trigger or hard coding into the application level.
>
> I have some web based forms that are processed and stored in Oracle
> 816. One of the objects in Oracle is a simple table consisting of
> several columns, one of which is a primary key of type number. I have
> a sequence that increments by 1. I want each new record to store the
> next value into the primary key column. Can an insert trigger be used
> in this manner. ie: All other column data will be inserted by an
> sqlnet call, but I want the primary key column to be inserted into by
> an insert trigger.
>
> Or, would the best method be to simply call the sequence next value
> and then insert everything from the application.
>
> Thanks in advance,
> Chuck
>
Received on Tue Dec 19 2000 - 05:19:50 CST

Original text of this message

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