This will not allow you to directly use the DDL structure inside the PLSQL procedure. To execute DDL you need to use the instruction Execute Immediate.
Use the following code:
CREATE OR REPLACE PROCEDURE SP_VEXISTABLA(Table_nameIN VARCHAR2)
IS
CANTIDAD integer;
BEGIN
SELECT COUNT(*) INTO CANTIDAD FROM USER_TABLES WHERE TABLE_NAME = Table_name;
DBMS_OUTPUT.PUT_LINE(CANTIDAD);
IF (CANTIDAD >0) THEN
DBMS_OUTPUT.PUT_LINE(Table_name);
execute immediate 'DROP TABLE ' || Table_name;
END IF;
END;
source
share