Home » SQL & PL/SQL » SQL & PL/SQL » what is the main usage of execute immediate. (11g)
what is the main usage of execute immediate. [message #643563] Mon, 12 October 2015 03:43 Go to next message
sudheerips
Messages: 7
Registered: September 2015
Location: visakhapatnam
Junior Member
what is the main usage of execute immediate.

why we are using execute immediate,we can run all types of commands like(DDL,DML,DCL,TCL,DQL) in execute immediate is there any other reason

what is difference between dynamic sql and static sql.
Re: what is the main usage of execute immediate. [message #643564 is a reply to message #643563] Mon, 12 October 2015 04:20 Go to previous messageGo to next message
John Watson
Messages: 9003
Registered: January 2010
Location: Global Village
Senior Member
I don't really understand your question, but if you are asking "when should one use EXECUTE IMMEDIATE" my answer would be "only if there is no alternative". Typically, this would be because you need to execute a DDL within your PL/SQL.
Re: what is the main usage of execute immediate. [message #643565 is a reply to message #643563] Mon, 12 October 2015 04:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68776
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Database PL/SQL Language Reference
Chapter 7 PL/SQL Dynamic SQL

Quote:
Dynamic SQL is a programming methodology for generating and running SQL statements at run time. It is useful when writing general-purpose and flexible programs like ad hoc query systems, when writing programs that must run database definition language (DDL) statements, or when you do not know at compilation time the full text of a SQL statement or the number or data types of its input and output variables.

Re: what is the main usage of execute immediate. [message #643566 is a reply to message #643565] Mon, 12 October 2015 05:08 Go to previous message
_jum
Messages: 577
Registered: February 2008
Senior Member
See also this thread in OTN Discussion Forum:

[Updated on: Mon, 12 October 2015 05:09]

Report message to a moderator

Previous Topic: Rownum per day
Next Topic: single row subquery returns more than one row
Goto Forum:
  


Current Time: Mon Jul 13 20:13:20 CDT 2026