How we can create a table in PL/SQL block. insert records into it? is it possible by some procedure or function? please give example?
Submitted by: AdministratorCREATE OR REPLACE PROCEDURE ddl_create_proc (p_table_name IN VARCHAR2)
AS
l_stmt VARCHAR2(200);
BEGIN
DBMS_OUTPUT.put_line('STARTING ');
l_stmt := 'create table '|| p_table_name || ' as (select * from emp )';
execute IMMEDIATE l_stmt;
DBMS_OUTPUT.put_line('end ');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('exception '||SQLERRM || 'message'||sqlcode);
END;
Submitted by: Administrator
AS
l_stmt VARCHAR2(200);
BEGIN
DBMS_OUTPUT.put_line('STARTING ');
l_stmt := 'create table '|| p_table_name || ' as (select * from emp )';
execute IMMEDIATE l_stmt;
DBMS_OUTPUT.put_line('end ');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('exception '||SQLERRM || 'message'||sqlcode);
END;
Submitted by: Administrator
Read Online Oracle PL-SQL Job Interview Questions And Answers
Top Oracle PL-SQL Questions
☺ | Explian rowid, rownum?what are the psoducolumns we have? |
☺ | what is the starting oracle error number? |
☺ | What is difference b/w stored procedures and application procedures, stored function and application function? |
☺ | In a Distributed Database System Can we execute two queries simultaneously? Justify? |
☺ | Name the tables where characteristics of Package, procedure and functions are stored? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |