Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute an SQL command in procedure

Status
Not open for further replies.

DCCoolBreeze

Programmer
Jul 25, 2001
208
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top