|
Why not use a sequence to populate ID, and let it
fire of a before insert trigger. code example below:
create sequence TAB1_PKSEQ ;
create or replace trigger test_pkgen
BEFORE INSERT OR UPDATE OF col_id on TABLE_A FOR EACH ROW BEGIN IF INSERTING THEN SELECT TAB1_PKSEQ1.NextVal INTO :new.COL_ID FROM DUAL; /* or something like the above */
END IF; END; / I am assuming you have other columns to populate
too, which is not the PK of the table.
Cheers :
Ferenc Mantfeld Dreaming costs you nothing. Not dreaming costs you everything.
|
- Re: SQL question Vladimir Begun
- RE: SQL question Jared . Still
- Re: SQL question Jared . Still
- Re: SQL question Jared . Still
- Re: SQL question Vladimir Begun
- Re: SQL question Vladimir Begun
- Re: SQL question Jared . Still
- SQL question Rick Stephenson
- Re: SQL question Alan Davey
- RE: SQL question DENNIS WILLIAMS
- RE: SQL question Ferenc Mantfeld
- RE: SQL question Rick Stephenson
- Re: SQL question Stephane Faroult
- Re: SQL question Ferenc Mantfeld
- RE: SQL question Richard Huntley
- SQL Question Madhavan Amruthur
- RE: SQL Question Chelur, Jayadas {PBSG}
- RE: SQL Question Madhavan Amruthur
- RE: SQL Question Chelur, Jayadas {PBSG}
- Sql question roland . skoldblom
- sql question David Boyd
