PL/SQL (MOSC)

MOSC Banner

How to create a trigger to prevent a table delete

edited Feb 23, 2011 1:39AM in PL/SQL (MOSC) 15 commentsAnswered
How to create a trigger to prevent a table delete

I get an error on line 8 ora_6502 if I change the

line to for i in 1 .. 1

I get ora 6531.

How do I initialize the variable of

ora_name_list_t type?

1 create or replace trigger t_trigger
2 before delete on t
3 declare
4 l_sql_text ora_name_list_t;
5 l_n number;
6 l_found boolean := false;
7 begin
8 l_n := ora_sql_txt(l_sql_text) ;
9 for i in 1 .. l_n
10 loop
11 l_found := upper(l_sql_text(i)) like '%WHERE%';
12 exit when l_found;
13 end loop;
14 if ( not l_found )

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center