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?