Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

max(rowid) question

1932140Mar 13 2018 — edited Mar 13 2018

Hi

I have come across the following code in one of packages I have to work on:

        select max(rowid) into l_rowid

          from trade_xxxx

         where cob_date = v_cob_date

           and rownum <= 1;

The l_rowid variable is then used at a point later in the package to identify a partition, which is subsequently truncated, i.e.

          select subobject_name into l_partition_name
            from user_objects
           where data_object_id = dbms_rowid.rowid_object(l_rowid)
             and object_name = 'TRADE_XXXX'
             and object_type = 'TABLE PARTITION';

Assuming there is no row movement (which I accept is rather presumptuous), the question is, is a rowid a monotonically increasing value, something akin to sequence ?

My view is that it should not be used, but can anybody elaborate on the reasons ?

Thanks

This post has been answered by Solomon Yakobson on Mar 13 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2018
Added on Mar 13 2018
11 comments
2,007 views