What is wrong with this????



I am trying to write a simple script to drop triggers for a user on a
10g database

declare
v_trgname varchar2(30);
v_dropstmt varchar2(60);
cursor c_triggers is
select trigger_name from user_triggers
where trigger_name not like 'TRG_%';
begin
open c_triggers;
loop
fetch c_triggers into v_trgname;
exit when c_triggers%notfound;
v_dropstmt := 'DROP TRIGGER ' || v_trgname;
execute immediate v_dropstmt;
end loop;
close c_triggers;
end;

As you can see there is no rocket science in the script. When I run
the script I get the following error:

Error at line 4
ORA-00933: SQL command not properly ended
ORA-06512: at line 13

Can anyone help, also the user has the permission to drop indexes

Cheers,
Adam
.



Relevant Pages

  • Re: weird while shellscript problem-SOLVED
    ... | That was the script, well as you can see CURRENT_HOUR is being declared ... | INSIDE of the while loop, so....it was impossible to run if I didn't ... | declare it before the loop :-) ... Manuel Arostegui Ramirez. ...
    (Fedora)
  • Re: Report in FM 6 or 7
    ... achieve this report format will have to be done via scripting. ... but they will simplify the script and Sort Order. ... End Loop ... The normal 'Dancer' field is used so that if there are more than one ...
    (comp.databases.filemaker)
  • Re: recreate database script not work
    ... I got a script which is supposed to regenerate database systax. ... REM gen_dbse_9.sql ... end loop; ...
    (comp.databases.oracle.server)
  • Re: weird while shellscript problem-SOLVED
    ... | That was the script, well as you can see CURRENT_HOUR is being declared INSIDE ... | of the while loop, so....it was impossible to run if I didn't declare it ...
    (Fedora)
  • Re: Loop Problem (At Least I think)
    ... If there are no images matching the product ... "" Then" statement (the one below the loop, outside of it), is this just ... >> script to finish. ... > 2) Read the database table and acess the dictionary object for the ...
    (microsoft.public.scripting.vbscript)