Why don't we use DDL statements with Static SQL in PL/SQL Blocks?
I have a query regarding 'why don't we use DDL statements in
PL/SQL block?', I know it is possible by using dynamic SQL( for example EXECUTE IMMEDIATE statement , DBMS_SQL package functions) , but I would like to know the detailed reason about 'why don't we .........?, For example
If we use this statement in Pl/Sql block 'Create table
Sample(col number(10))', when we compile this pl/sql block then Oracle starts parsing first(as per of parsing concept what ever object (here the example is table 'Sample') we used that object must exist in the Database, So the table 'Sample' has not yet created, So this is wrong
My doubt is, just assume that the table 'employee' is already existed in the Database, then why don't we use 'Drop table employee' statement in pl/sql block, like this why don't we use 'Alter table ...........' statement in pl/sql block.
Could you please give a detailed explanation about this query, I
referred many books, but they said we can't use DDL statements in pl/sql block, to do this we must use Dynamic sql, But I would like to know that What is the reason why DDL using with Static SQL not work in pl/sql block and what will happen when Parsing has done
I am expecting the answer from You, Reply soon please
Thanks
Amar Kambam