Home » SQL & PL/SQL » SQL & PL/SQL » rowid mystry
rowid mystry [message #242312] Fri, 01 June 2007 09:58 Go to next message
kidoos
Messages: 11
Registered: June 2007
Junior Member
update t1 set field1='d' where rowid =chartorowid('AASAEEFFAAS\')

upadte t1 set field1='d' where rowidtochar(rowid) = 'AASAEEFFAAS\'

which of these update statement will be faster .
and please explain why it is so ?

thanks
Re: rowid mystry [message #242313 is a reply to message #242312] Fri, 01 June 2007 10:01 Go to previous messageGo to next message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
I'd say run an EXPLAIN PLAN on both and see what results you get.
Re: rowid mystry [message #242340 is a reply to message #242313] Fri, 01 June 2007 11:05 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
And after saying what joy already said, I'd say be very very careful using rowids like that...
Re: rowid mystry [message #242341 is a reply to message #242340] Fri, 01 June 2007 11:06 Go to previous messageGo to next message
kidoos
Messages: 11
Registered: June 2007
Junior Member
why ? isn't it safe ?
Re: rowid mystry [message #242348 is a reply to message #242341] Fri, 01 June 2007 11:14 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It depends where do you get the 'AASAEEFFAAS\' value and if the related rows is locked or not.
If it is locked from the time you get its rowid to the time you update it, it is safe.
Otherwise, you'll likely have problems.

Regards
Michel
Previous Topic: Data in to single row (take your time I'm in no rush)
Next Topic: how upadte statement works
Goto Forum:
  


Current Time: Sat Dec 10 05:25:28 CST 2016

Total time taken to generate the page: 1.93750 seconds