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 difference between a subquery and a join?
What are character functions?
Can I join the same table twice?
What are the ways on commenting in a pl/sql code?
Can we have two clustered index on a table?
Explain what is an index?
what is a view? : Sql dba
How many joins can you have in sql?
Why is pl sql used?
What is trigger types in sql?
Explain the commit statement.
What is the command used to fetch the first 5 characters of a string?
How do I truncate a word?
What are the popular database management systems in the it industry?
What is difference between sql and excel?