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
Does mysql support pl sql?
What is pragma in sql?
Why having clause is used in sql?
What is trigger in sql? Explain
What is view explain with example?
What are the different set operators available in sql?
What is data profiling in sql?
Does execute immediate commit?
What is the difference between a query and a report?
how many ways we can we find the current date using mysql? : Sql dba
What is localdb mssqllocaldb?
What are all the different normalization?
How do I filter in sql profiler?
What is the plv (pl/vision) package offers?
What are the different types of sql commands?