Referencing TRIGGER_BODY text from DBA_TRIGGERS
771626Jun 16 2010 — edited Jun 16 2010Running 11.2.0.1.0
In PL/SQL I want to select data from DBA_TRIGGERS dependent on the contents of the TRIGGER_BODY.
i.e.
select * from dba_triggers where trigger_body like '%XXX%'
Executing the above gets:
SQL Error: ORA-00932: inconsistent datatypes: expected NUMBER got LONG
trigger_body is defined as a long.
If I just execute "SELECT * from DBA_TRIGGERS" I can see the trigger_body data as text.
I have tried the below but they all fail with data type errors:
select utl_raw.cast_to_varchar2(trigger_body, 1, 10) from DBA_TRIGGERS
select utl_raw.cast_to_varchar2(dbms_lob.substr( trigger_body, 32000, 1 )) from DBA_TRIGGERS
Is what I want to do possible?
thanks for any help on this.