Hi All

DECLARE
cnt number;
BEGIN
SELECT count(*) INTO cnt
FROM user_tables
WHERE table_name = 'SAMPLE_TABLE_01';
IF cnt = 0 THEN
execute immediate 'CREATE TABLE SAMPLE_TABLE_01
(
sample_column01 DATE,
sample_column02 VARCHAR2 (128),
sample_column03 VARCHAR2 (255) NOT NULL,
sample_column04 BLOB,
CONSTRAINT sample_primary_key_pk PRIMARY KEY (sample_column03) )' ;
execute immediate 'CREATE INDEX sample_index01 ON SAMPLE_TABLE_01 (sample_column01 ASC,sample_column03 ASC)';
DBMS_OUTPUT.PUT_LINE('SAMPLE_TABLE_01' || 'table is created.');
ELSE
DBMS_OUTPUT.PUT_LINE('SAMPLE_TABLE_01' || 'table already exists.');
END IF;
END;
/

In SQL developer, if SAMPLE_TABLE_01 exists, i get the message 'table already exists' or otherwise. However in SQL PLUS, I receive oracle exception ORA-00955: name is already used by an existing object
It does not evaluate for IF and does not go in the DBMS_OUTPUT line. Please help.