Oracle8 PL/SQL Programming by Scott Urman published by Osborne-McGraw Hill ISBN 0-07-882305-6
>This is even better than my After Insert trigger. I do lack experience in how to write triggers in Oracle. I have searched several of the major bookstores here for high powered Oracle developer books with an emphasis on PL/SQL. If you have any recommendations, I would sure appreciate a pointing in the right direction. All of my training has been in the Oracle DBA courses and some SQL. The SQL, I have mostly picked up as I go along.
>
>>You could also populate the column using a 'Before Insert' trigger in Oracle:
>>
>>CREATE OR REPLACE TRIGGER SOMETABLE_INSERT
>> BEFORE INSERT ON SOMETABLE FOR EACH ROW
>>
>> DECLARE
>>
>> v_Id Number;
>>
>>
>> BEGIN
>>
>> If :new.id_column Is Null Then
>>
>> Select CompanyFNext Into v_Id from dual;
>> :new.id_column := v_Id;
>> End If;
>>End;
>>
>>To use the trigger mechanism you will have to allow your id column to be nullable so that Oracle wont complain about not having a value when you do the insert.
>>
>>What you may find is that by altering the underlying data structure the other application that interacts with the database may be 'broken'.
>>
>>Mark
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only