RE: Doubt related to ROWID

From: Brady, Mark <mbrady_at_allegisgroup.com>
Date: Fri, 12 Jul 2013 15:02:41 -0400
Message-ID: <DB806F2BEB98ED4FB8172F8CE09447FF9985EAED89_at_EXCH-MBX05.allegisgroup.com>



As people here have pointed out ROWID is unique within a table but not between them (when not an IOT). But what's the goal of adding that column?

I know you're trying to simplify the example to give us the gist of the issue but you've over-simplified.

In other words, the addition of the ROWID column to the query in the example has no tangible effect. It seems like the developer is trying to avoid losing rows as the result of a UNION but the ALL is preventing that. If all you want is a unique value if you concatenate the table_name to the rowid. If you selecting between schemas then concat the schema_name too. But why?

-----Original Message-----
From: Eriovaldo Andrietta [mailto:ecandrietta_at_gmail.com] Sent: Friday, July 12, 2013 2:37 PM
To: Brady, Mark
Cc: hurleyjohnb_at_yahoo.com; ORACLE-L
Subject: Re: Doubt related to ROWID

Great Brady !!!

There is a query that retrieves data from 2 tables, something like this:

select column_rowid,

             column_1,
             column_2
from (
             SELECT ROWID column_rowid,
                              column_1,
                              column_2
              FROM table1
              union all
             SELECT ROWID column_rowid,
                              column_1,
                              column_2
              FROM table2)

The column column_rowid are from different tables and I cannot use this as a unique. People tried do it and I did not allow, because its (rowid) can be equal. And then I asked here to clarify and confirm the concept.

Did you get the idea and doubt ?

Regards
Eriovaldo

On Fri, Jul 12, 2013 at 3:03 PM, Brady, Mark <mbrady_at_allegisgroup.com> wrote:
> Better idea is to tell us what you're trying to accomplish... If you're trying to use a ROWID as a permanent way to get back to a row with no PK, keep in mind that the ROWID is not permanently assigned... it can be changed.
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of John Hurley
> Sent: Wednesday, July 10, 2013 7:02 PM
> To: ecandrietta_at_gmail.com; ORACLE-L
> Subject: Re: Doubt related to ROWID
>
> This looks reasonably up to date ( just a quick look though ) ...
>
> http://amitstechblog.wordpress.com/2011/09/21/oracle-rowid-and-its-uni
> queness/
>
> Sometimes doing your own research and then testing/breaking any assumptions gives the best learning experience.
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
>
> This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jul 12 2013 - 21:02:41 CEST

Original text of this message