Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to call DDL statements from pl/sql?

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


Please Help Members By Posting Answers For Below Questions

how to select unique records from a table? : Sql dba

1091


How do I add a primary key to a table?

1025


Can we call a function containing dml statements in a select query?

960


Explain the commit statement.

1138


What is an emotional trigger?

983


How insert into statements in sql?

1056


What is sequence in sql?

987


how many groups of data types? : Sql dba

1000


how many triggers are allowed in mysql table? : Sql dba

1040


how can we submit a form without a submit button? : Sql dba

963


What is sql partition function?

1183


what is an extent ? : Sql dba

1072


what is error ora-03113: end-of-file on communication channel?

1148


Can we call stored procedure in function?

938


What is the primary use of normalization?

984