Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Updating by RowId when alread has fetched the row....

Re: Updating by RowId when alread has fetched the row....

From: Mark <simmons_mark_at_yahoo.com>
Date: 5 Mar 2004 16:08:09 -0800
Message-ID: <5366fb41.0403051608.37ccc7ab@posting.google.com>


I don't know of anyone that would consider executing DML code on a table while they were re-organizing it like this. So your example doesn't make a lot of sense.

Mark Simmons
Sr. Oracle DBA
Sabre-Holdings, Southlake, TX

srivenu_at_hotmail.com (srivenu) wrote in message news:<1a68177.0403050353.370e1024_at_posting.google.com>...
> Small note (May not be a problem but just wanted to show).
> create table x(a number);
> insert into x values(1);
>
> from session 1
> declare
> v1 rowid;
> begin
> select rowid into v1 from x;
> dbms_lock.sleep(20);
> update x set a=100 where rowid=v1;
> end;
> /
>
> from session 2 - After 5 secs of starting the above in session 1
> alter table x move tablespace users;
>
> Session 1 error
> ERROR at line 1:
> ORA-01410: invalid ROWID
> ORA-06512: at line 6
>
> Even worse you may update a wrong row.
> May want to convert that select rowid into v1 from x into a select
> rowid into v1 from x for update.
>
> regards
> Srivenu
Received on Fri Mar 05 2004 - 18:08:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US