Partition table - High_Value in DD-MON-YYYY format [message #639508] |
Thu, 09 July 2015 00:49 |
hitesh.bhatt
Messages: 84 Registered: February 2014 Location: INDIA
|
Member |
|
|
Hi All,
I have to create procedure which will accept DATE and TABLE_NAME as Input and provide respective PARTITION_NAME, so I used following SQL script -
select table_name,
partition_name,
to_date (
trim (
'''' from regexp_substr (
extractvalue (
dbms_xmlgen.
getxmltype (
'select high_value from all_tab_partitions where table_name='''
|| table_name
|| ''' and table_owner = '''
|| table_owner
|| ''' and partition_name = '''
|| partition_name
|| ''''),
'//text()'),
'''.*?''')),
'syyyy-mm-dd hh24:mi:ss')
high_value_in_date_format
from all_tab_partitions;
The above script works fine and gives output as "DD-MON-YYYY", if the HIGH_VALUE data as follows -
TO_DATE(' 2010-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'
But if the HIGH_VALUE data as follows, then it gives output as BLANK -
Can anyone please help how to modify script so it will give the output for all the format as - DD-MON-YYYY
Many Thanks in advance.
Hitesh
|
|
|
|
|
|