Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: sequences as defaults
In article <8dqe7c$360$1_at_nnrp1.deja.com>,
arpinog_at_my-deja.com wrote:
> Is it possible to set a sequence as a coumn
> default on a table in Oracle 8? Is there any
> thing similar to a Sybase identity column in
> Oracle?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
you need a trigger to do this.
create or replace trigger my_trigger
before insert on T for each row
begin
select my_seq.nextval into :new.my_primary_key from dual;
end;
-- Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries http://osi.oracle.com/~tkyte/index.html -- Opinions are mine and do not necessarily reflect those of Oracle Corp Sent via Deja.com http://www.deja.com/ Before you buy.Received on Sat Apr 22 2000 - 00:00:00 CDT
![]() |
![]() |