Home » SQL & PL/SQL » SQL & PL/SQL » Rowid
Rowid [message #8665] Wed, 17 September 2003 18:14 Go to next message
Jay
Messages: 127
Registered: October 1999
Senior Member
Hi,

Does Oracle have any other unique identification for a row other than rowid? Is there anything like a version number for each row?

Thanks,
Jay
Re: Rowid [message #8666 is a reply to message #8665] Wed, 17 September 2003 18:27 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Jay, what are you trying to accomplish? ROWID is _the_ unique internal identification for a row.
Re: Rowid [message #8667 is a reply to message #8665] Wed, 17 September 2003 18:29 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
Nope.

Also rows are not returned in any predictable order.

Thiru
Re: Rowid [message #8741 is a reply to message #8665] Tue, 23 September 2003 03:57 Go to previous messageGo to next message
Bipul
Messages: 11
Registered: June 2003
Junior Member
There is ROWNUM which is uniquelly identify row in a table,that is used with inline view.
Re: Rowid [message #8751 is a reply to message #8741] Tue, 23 September 2003 15:19 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
ROWNUM doesnt uniquely identify a row in the table. Rownum gets assigned as the rows are fetched from the result set.
Re: Rowid [message #8801 is a reply to message #8665] Thu, 25 September 2003 20:28 Go to previous messageGo to next message
Jay
Messages: 127
Registered: October 1999
Senior Member
Thanks for your replies and my apologies for getting back so late.

What I want to do is as follows:
1. I've a table which has a row.
2. Two people are have loaded their web forms which displays the data from that row.
3. Both of them want to modify the data and they submit the form.
4. But, I should allow the first modification that comes only. For the other I would want to raise an exception telling that the data is already modified.

I don't want to do a select for update when the data gets selected as that would lock the row.

One way of doing that is to store the data in my code when they get selected. And then before updating I can select(for update) the data again from the table and see if anything has changed. If so I'll throw an error. That works fine if the row has one column or few column. But, this row has approximately 80 columns, and I don't want to match each and every column.
What I am hoping is that Oracle would store a version for each row and changes that everytime when the row gets updated. Is there anything like that.
Re: Rowid [message #8932 is a reply to message #8801] Fri, 03 October 2003 11:19 Go to previous messageGo to next message
Scott Whittaker
Messages: 1
Registered: October 2003
Junior Member
Perhaps adding a last_modified column to your database with a timestamp would suffice? On update check the last_modified and if it doesn't match your value throw the error. You'll probably want a trigger to update the row when created/changed.

Regards,

Scott
Re: Rowid [message #8956 is a reply to message #8932] Mon, 06 October 2003 13:40 Go to previous message
Jay
Messages: 127
Registered: October 1999
Senior Member
Scott,
That is what I intend to do. But, I was wondering if Oracle maintains something like the last updated date(time) internally, and I could get hold of that. Probably, there is nothing like that.

Thanks,
Jay
Previous Topic: Newline character in a string
Next Topic: Date difference
Goto Forum:
  


Current Time: Fri Apr 26 11:51:25 CDT 2024