Answers were Sorted based on User's Feedback
Answer / pavan_1981
One can call DDL statements like CREATE, DROP, TRUNCATE,
etc. from PL/SQL by using the "EXECUTE IMMEDATE" statement.
Users running Oracle versions below 8i can look at the
DBMS_SQL package .
EXECUTE IMMEDIATE 'CREATE TABLE X(A DATE)';
NOTE: The DDL statement in quotes should not be terminated
with a semicolon.
Another way is One can also use the older DBMS_SQL package
(V2.1 and above) to execute dynamic statements. Look at
CREATE OR REPLACE PROCEDURE DYNSQL AS
cur := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(cur, 'CREATE TABLE X (Y DATE)',
rc := DBMS_SQL.EXECUTE(cur);
|Is This Answer Correct ?||28 Yes||4 No|
Answer / santosh kumar
v_ddl_stat varchar2(200):='create table '||'&table_name'||'
('||'&column_names'||')'; --col_name like(eid number(5),name
EXECUTE IMMEDIATE v_ddl_stat;
|Is This Answer Correct ?||8 Yes||4 No|
Answer / oracle_tigress
for this question when i answered as we can user package
DBMS_DDL package it was correct..let me know whether it is
write or not..
|Is This Answer Correct ?||4 Yes||3 No|
Answer / parag tyagi
CREATE OR REPLACE PROCEDURE emp_test( in_name VARCHAR2) IS
EXECUTE IMMEDIATE ('grant create table to user_name');
EXECUTE IMMEDIATE ('create table ' || in_name || '(name
SELECT '1' INTO cnt FROM User_Objects WHERE object_name
IF cnt IS NOT NULL THEN
WHEN OTHERS THEN
dbms_output.put_line('Name is already used by an existing
|Is This Answer Correct ?||6 Yes||6 No|
what is Hash join?how it is different from inner join?what is the sign used for inner join?(eg: like the (+) sign used for outer join)?
what are the differences among these table level lock modes - IN SHARE MODE, IN SHARE UPDATE MODE, IN EXCLUSIVE MODE ?
write a procedure to print a statement or number not using "dbms_output.put_line" package.write a procedure instead of it using procdure name as "print" ex:- declare a number:=2; begin print(a); end; /* when U type above procedure 2 have to should be printed*/
What is the maximum number of triggers,can apply to a single table?
----> There is a table T with two columns C1 and C2. The data is as below: C1 C2 1 4 2 5 3 6
declare l1 number := null; l2 number :=null; begin if l1=l2 then message('equal'); else if l1<>l2 then message('not equal'); else message('else'); end if; end if; end; What will be the output ?
Give an example of any procedure.
What is the difference between the Primary and Foreign key?
sales persons should always receive commission of 100 at least. employees who r not sales persons should never receive commission.(Triggers)
What is the different between Stored Procedure and Procedure?
Explain the usage of WHERE CURRENT OF clause in cursors ?
What is difference between CHAR and VARCHAR2?What is the maximum SIZE allowed for each type?