DCCoolBreeze
Programmer
OK. I want to truncate a table given a specific set of criteria has been met. How can I do this in the following example:
declare
criteria1 varchar2(1) := 'N';
begin
criteria1 := 'Y';
if (criteria1 = 'Y') then
exec sql truncate table table1; (does not work)
commit;
else
dbmus_output.put_line('criteria not met');
end if;
end;
prompt>sqlplus username/password@db @truncate_table.sql
declare
criteria1 varchar2(1) := 'N';
begin
criteria1 := 'Y';
if (criteria1 = 'Y') then
exec sql truncate table table1; (does not work)
commit;
else
dbmus_output.put_line('criteria not met');
end if;
end;
prompt>sqlplus username/password@db @truncate_table.sql