Discussion in 'SQL PL/SQL' started by krithika@2001, Jun 17, 2009.
Can anybody explain the use of EXECUTE IMMEDIATE in SQL with example
Execute Immediate is to be used in either PL/SQL block or or anonymous bloack and not in SQL. But It can be executed against SQL and PL/SQL block.
Check this links for some simple examples.
In plsql for execution of any DDL statement we require Execute immediate
Not necessarily EXECUTE IMMEDIATE.
Any type of Dynamic SQL will do the trick.ie, even DBMS_SQL package will do it for you.
Though Execute immediate almost replaced the DBMS_SQL package , some times DBMS_SQL cannot be avoided.