Home » SQL & PL/SQL » SQL & PL/SQL » Is it safe to use ROWID for update statements
Is it safe to use ROWID for update statements [message #344053] Thu, 28 August 2008 12:42 Go to next message
bogey
Messages: 53
Registered: February 2006
Member
I'm looking at statments through logminer and I've noticed some stmts like such:

update "MASTER"."LEARNER" set "SUBMISSION" = '27' where "SUBMISSION_" = '26' and ROWID = 'AAAOY7AAFAAAGmCAAa';


Is this safet to do, relying on the ROWID ??

thanks.
Re: Is it safe to use ROWID for update statements [message #344055 is a reply to message #344053] Thu, 28 August 2008 12:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Is this safet to do...??

For who?

Regards
Michel
Re: Is it safe to use ROWID for update statements [message #344065 is a reply to message #344053] Thu, 28 August 2008 12:54 Go to previous messageGo to next message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
Hello,

A rowid is a pseudo column that uniquely identifies a row within a table, but not within a database. It is possible for two rows of two different tables stored in the same cluster to have the same rowid.

Although a rowid uniquely identifies a row in a table, it might change its value if the underlying table is an index organized table or a partitioned table.

Also, rowids change if a table is exported and imported using EXP/IMP.

This implies that rowids should not be stored away for later re-use as the corresponding row then might either not exist or contain completely different data.

I Hope this helps.... Smile
Re: Is it safe to use ROWID for update statements [message #344068 is a reply to message #344055] Thu, 28 August 2008 13:01 Go to previous messageGo to next message
bogey
Messages: 53
Registered: February 2006
Member
Safe for the application itself becuase its possible for the rowid to change, correct?

thanks.
Re: Is it safe to use ROWID for update statements [message #344073 is a reply to message #344068] Thu, 28 August 2008 13:07 Go to previous messageGo to next message
joy_division
Messages: 4642
Registered: February 2005
Location: East Coast USA
Senior Member
bogey wrote on Thu, 28 August 2008 14:01
Safe for the application itself becuase its possible for the rowid to change, correct?



This sentence makes no sense to me. If a rowid can change, how can you say it's safe for an application to use it?
Re: Is it safe to use ROWID for update statements [message #344076 is a reply to message #344068] Thu, 28 August 2008 13:12 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is a Log Miner statement, it is safe for Oracle to use it in the conditions it is written to use it.
It is not safe for you to use it unless you exactly what you do and especially you are sure you are pointing to the correct row.

Regards
Michel
Previous Topic: Heterogeneous Services datatype conversion error
Next Topic: missing right paranthesis
Goto Forum:
  


Current Time: Wed Dec 07 16:19:31 CST 2016

Total time taken to generate the page: 0.10583 seconds