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
how to start mysql server? : Sql dba
What is substitution variable in pl sql?
How to prepare for oracle pl sql certification?
how to convert numeric values to character strings? : Sql dba
What are the ddl commands?
What are packages in pl sql and also explain its advantages?
How many sectors are in a partition?
What is lexical units in pl sql?
What is rank dense_rank and partition in sql?
Is time a data type in sql?
what is the use of friend function? : Sql dba
What is input buffer in sql*plus?
how would you get the current date in mysql? : Sql dba
What is sql stand for?
how can we repair a mysql table? : Sql dba