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!

How to use long column in where clause

We have requirement to query all_tab_partitions based on high_value

select * from ALL_TAB_PARTITIONS where table_name='<table_name>' and high_value=2;

getting this error

ORA-00997: illegal use of LONG datatype 00997. 00000 - "illegal use of LONG datatype" *Cause: *Action: Error at Line: 3 Column: 70

tried few , but did not work
SELECT table_name, partition_name FROM all_tab_partitions WHERE table_name = '<table_name>' AND DBMS_XMLGEN.CONVERT(high_value, 1) = '2';

SELECT table_name, partition_name FROM all_tab_partitions WHERE table_name = '<table_name>' AND TO_CHAR(high_value) = '2';
Any pointers please

This post has been answered by Paulzip on Mar 13 2024
Jump to Answer
Comments
Post Details
Added on Mar 12 2024
15 comments
2,547 views