Re: To find a just-inserted record

From: AndrewV <andrew.velichko_at_moh.gov.on.ca>
Date: 21 Dec 2001 10:29:13 -0800
Message-ID: <335c961b.0112211029.3d1109d9_at_posting.google.com>


Hi!

We have Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production and the following code work fine:

create table tmp2 (f1 number);
declare
  l_rowid varchar2(20);
begin
  dbms_output.enable;
  insert into tmp2 values(1) returning rowid into l_rowid;   dbms_output.put_line(l_rowid);
end;
/
drop table tmp2;

Regards,

Andrew Velichko
Brainbench MVP for Oracle Developer 2000 http://www.brainbench.com


S P Arif Sahari Wibowo <arifsaha_at_yahoo.com> wrote in message news:<Pine.LNX.4.42.0112210942380.28418-100000_at_macbeth.tirone.com>...
> Hi!
>
> Do you know how to make sure we can found a record that we just inserted?
>
> Obviously this is in programming context, a routine just execute an
> 'insert' sql command, but have to pass the rowid of that record to other
> routines. Obviously the rowid cannot be known before the record is
> inserted.
>
> Any idea how to keep a 'hold' on that newly inserted record?
>
> I try this on an Oracle 8.1.6 on Red Hat Linux using perl's DBI.
>
> Thank you!
Received on Fri Dec 21 2001 - 19:29:13 CET

Original text of this message