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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How are the parameters of TBL$OR$IDX$PART$NUM?

BEDEFeb 6 2019 — edited Feb 8 2019

So far, I could find two usages of the function, illustrated below.

1)

select tp.*, obj.*

from sys.dba_objects obj

join all_tab_partitions tp on tp.table_name=obj.OBJECT_NAME and tp.table_owner=obj.OWNER and tp.partition_name=obj.SUBOBJECT_NAME

where obj.OBJECT_ID=TBL$OR$IDX$PART$NUM("SPI"."CD_YALA_BALANCES", 0, 3, 0, '151285')

;

That is I am looking for a partition containing the value '151285'. The table is partitioned by range interval on a number column. And I can see in the high_value column 151286, which is right. If I set the last parameter 151285', value which is not found in the table, I get no rows.

2)

with tb as (

select TBL$OR$IDX$PART$NUM("SPI"."CD_YALA_BALANCES", 0, 4, 0, t.rowid) objn, t.*

from cd_yala_balances t

)

select obj.OBJECT_NAME, obj.SUBOBJECT_NAME, tb.*

from tb

join sys.dba_objects obj on tb.objn=obj.OBJECT_ID

;

I thus get the partition for each row found in table.

What is the meaning of each of the function parameters? Other use cases?

Trying different values for the second, third and fourth parameters I got various errors...

Who would know more?

Comments

Post Details

Added on Feb 6 2019
8 comments
2,698 views