Background: ALL_IND_EXPRESSIONS has a column
COLUMN_EXPRESSION LONG Function-based index expression defining the column
I know that LONG deprecated. I need to write something like (or do other text operations):
SELECT REPLACE(REPLACE(REPLACE( q'{ALTER INDEX "<index_owner>"."<index_name>" ON ... (<column_expression>)}' ,'<index_owner>', index_owner ) ,'<index_name>', index_name) ,'<column_expression>', column_expression) AS result FROM all_ind_expressions;
ORA-00932: inconsistent data types: expected NUMBER received LONG
DBFiddle Demo
Notes:
- it must be a standalone request
- no intermediate objects (creating a table / view is not an option).
- no
PL/SQL block DBMS_METADATA.GET_DDL (this is not the case)- With a FUNCTION clause as a last resort
Can I enable / convert / use the built-in function from LONG to VARCHAR2 ?
EDIT TL; DR:
SELECT column_expression || 'a'
source share