Answer Posted / kavitha nedigunta
set serveroutput on;
DECLARE
CNT NUMBER;
table_name varchar2(300) := 'testnew';
BEGIN
--EXECUTE IMMEDIATE ('grant create table to user_name');
EXECUTE IMMEDIATE ('create table '||table_name||'(name
varchar2(10))');
SELECT COUNT(*) INTO CNT FROM USER_OBJECTS WHERE OBJECT_NAME = upper(''||table_name||'');
IF cnt > 0 THEN
dbms_output.put_line('Table Created');
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Name is already used by an existing object');
END;
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the most restrictive isolation level? : Transact sql
how to load data files into tables with 'mysqlimport'? : Sql dba
What is left join example?
How do I enable sql encryption?
What is sql engine in oracle?
What is auto increment feature in sql?
Differentiate between pl/sql and sql?
What is a database? Explain
What is the location of pre_defined_functions.
Differentiate between syntax and runtime errors.
What is plpgsql language?
Explain the types of joins in sql?
how can you create an empty table from an existing table? : Sql dba
How many disk partitions should I have?
Which software is used for pl sql programming?