Answer Posted / parag tyagi
CREATE OR REPLACE PROCEDURE emp_test( in_name VARCHAR2) IS
cnt NUMBER;
BEGIN
EXECUTE IMMEDIATE ('grant create table to user_name');
EXECUTE IMMEDIATE ('create table ' || in_name || '(name
varchar2(10))');
SELECT '1' INTO cnt FROM User_Objects WHERE object_name
= 'EMP_TEST';
IF cnt IS NOT NULL 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 ? | 6 Yes | 6 No |
Post New Answer View All Answers
What is the example of procedure?
How to fetch alternate records from a table?
What is a heap in sql?
what are the different functions in sorting an array? : Sql dba
Why do we need databases?
What is substitution variable?
Does db2 use sql?
What type of database is sql?
What is a table in a database?
What is a primary key example?
- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?
What is native sql query?
What are the different types of joins in sql?
What is the difference between join and natural join?
what happens if null values are involved in expressions? : Sql dba