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 are commit, rollback, and savepoint?
explain normalization concept? : Sql dba
what is the syntax used for partition in tsql? : Transact sql
Can a table have no primary key?
What are the different types of a subquery?
how to convert dates to character strings? : Sql dba
What is record data type?
What are the different types of database management systems?
what is sub-query? : Transact sql
What do you mean by rowid?
What is the use of desc in sql?
How do I remove sql plus from windows 10?
hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews
What is function and procedure?
What is the difference between inner join and left join?