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 / 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


Please Help Members By Posting Answers For Below Questions

how to start mysql server? : Sql dba

1181


What is substitution variable in pl sql?

1026


How to prepare for oracle pl sql certification?

1046


how to convert numeric values to character strings? : Sql dba

1083


What are the ddl commands?

989


What are packages in pl sql and also explain its advantages?

1012


How many sectors are in a partition?

1061


What is lexical units in pl sql?

1118


What is rank dense_rank and partition in sql?

1006


Is time a data type in sql?

887


what is the use of friend function? : Sql dba

1009


What is input buffer in sql*plus?

1190


how would you get the current date in mysql? : Sql dba

952


What is sql stand for?

970


how can we repair a mysql table? : Sql dba

956