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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP 'Warning: Procedure created with compilation errors.'

Status
Not open for further replies.

Giddygoat

Programmer
May 16, 2001
36
GB
Why do I get a warning when I run this code?

CREATE OR REPLACE PROCEDURE EnvoyDropTable (envoy_table_name in varchar2)
AS
v_rows NUMBER;
BEGIN
select count(*) into v_rows
from all_tables
where table_name = envoy_table_name AND owner = 'ENVOY';
if v_rows <> 0 then
drop table envoy_table_name;
end if;
END EnvoyDropTable;
/

The warning is this .....
Warning: Procedure created with compilation errors.

Also
Is there a better way to do what I am doing in the procedure? i.e. Checking to see if a table exists before I drop it?

Thanks

John
 
You can not use DDL commands within pl/sql diretcly, you should use dynamic sql (EXECUTE IMMEDIATE or DBMS_SQL). You may use SHOW ERRORS sql*plus command to see the real error occured.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top