Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: INSERT trigger question..
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,
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