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 sap sql?
Which is faster view or stored procedure?
What are the types of join and explain each?
what are the advantages of mysql in comparison to oracle? : Sql dba
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?
What is the usage of sql functions?
What are basic techniques of indexing?
What is hibernate and its relation to sql?
how many tables will create when we create table, what are they? : Sql dba
what are integrity rules?
What is a pl/sql block?
What is meant by cursor in sql?
What are the three pl sql block types?
Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?
What is a sql*loader control file?