Home » RDBMS Server » Server Administration » Re: Sequence vs Rowid in primary key
Re: Sequence vs Rowid in primary key [message #370251] Mon, 12 July 1999 09:24
hmg
Messages: 40
Registered: March 1999
Member
I don't know if the script below could help you
but take a look about it.
:new and :old are pseudorecords in which the
column rowid is included. But I heard that the
rowid of one row could be changed, so that's
not the right solution.

create table chg_values (id number(10),
row_id varchar2(30) );

create table work ( id number(10) );

create or replace trigger change
after insert or update or delete on work
for each row
begin
if inserting then
insert into chg_values (id, row_id) values ( :new.id, :new.rowid );
end if;
end;
/

insert into work values (17);

select * from chg_values;

SQL> select * from chg_values;

ID ROW_ID
--------- ------------------------------
17 AAAEeZAACAAAXWlAAA
Previous Topic: Re: MS SQL Server to Oracle
Next Topic: Re: Sequence vs Rowid in primary key
Goto Forum:
  


Current Time: Wed Oct 28 06:57:28 CDT 2020