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!

getting error while executing this select statement

user 777111Jun 29 2010 — edited Jun 29 2010
Hi All,

I am new to this community.

I am getting error whie compiling the below code. Its telling 'Text' is invalid identifier. Also i want to know how can we obtain 'parseable' version of the below query?

my basic intention is to create a trigger header through a select statement and show it the complete text as a single column..

select text from
(select 'CREATE OR REPLACE TRIGGER '||SUBSTR(column_name,2,4)||'aud
AFTER INSERT
OR UPDATE
OF '||column_name||',
OR DELETE ON '||table_name||'
FOR EACH ROW'
FROM(SELECT lower(REPLACE(column_name,'O_','')) column_name , /*changing O to O_*/
lower(replace(t.table_name,'_A_','_')) table_name,
lower(t.table_name) table_name1,
c.column_id
FROM all_tab_columns c,
(SELECT object_name table_name
FROM all_objects
WHERE object_name LIKE '%/_A/_%' ESCAPE '/') t
WHERE c.table_name(+) = t.table_name
AND SUBSTR(column_name(+),1,2) = 'O_'))
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2010
Added on Jun 29 2010
9 comments
790 views