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

The select into statement is most often used to create backup copies of tables or for archiving records?

1062


What is a sql instance vs database?

1110


Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

1201


What is coalesce in sql?

1051


How to prepare for oracle pl sql certification?

1056


Is sql workbench free?

988


What are the types of sql commands?

1094


How do I find duplicates in the same column?

1077


What is sql dialect?

1110


How many unique keys can a table have?

1010


what is sql in mysql? : Sql dba

1185


What is data type in database?

986


What is pl sql quora?

1143


Explain how can you save or place your msg in a table?

1026


What is cross join sql?

912