what are Dynamic SQL statements?
Answers were Sorted based on User's Feedback
Answer / tharanath.n
A SQL statement is dynamic if it is constructed
at runtime and then executed.
we can use ddl commands by dynamic sql, without we can't
use.
| Is This Answer Correct ? | 16 Yes | 1 No |
Answer / soujanya
A SQL statement is dynamic if it is constructed
at runtime and then executed.
| Is This Answer Correct ? | 9 Yes | 2 No |
Answer / naresh
Basically Dynamic SQL means, you'll construct a SQL
statement dynamically while runtime and run it.
Why this needed: Since the stored database objects
(Procedures and Functions and others) will be compiled while
creating and stored inside a database.so everything has been
checked already. so whenever you make a call to these
programs they will directly run withou compiling second time.
since it runs without compiling you cannot use DDL commands
inside a stored program.
So to avoid this you can directly mention Execute Immediate
keywords in front of a SQL query dynamically in your
block.so that it'll work this time.
Hope this helps.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / brahmam
-> the combination of Sql and Plsql is called dynamic Sql.
when ever sql statements executed runtime then we are using
Execute immediate clause in executable section of the plsql block.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / thanvi
Both compilation and execution happens at the time.It will be useful where we don't know (the value of col_name or table_name) till runtime.
-Compilation means checks for the syntax.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / tharanath.n
A SQL statement is dynamic if it is constructed
at runtime and then executed.
we can use ddl commands by dynamic sql, without we can't
use.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / vishal kumar
Sql statement should be written in quotes like
'select table1.col1, tabel2.col2 from table1,table2 where
table1.col3=table2.col4'
and we can execute through below command "execute immidiate"
EXECUTE IMMEDIATE 'select table1.col1, tabel2.col2 from
table1,table2 where table1.col3=table2.col4'
it execute at runtime, means its not allowed as static.
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / manoj
It take value dynamicaly at run time
Need:- If we need DDL in programming as "CREATE, INSERT"
.. It always written in single
quote " 'sql_statement ' " both end
with termination " ; "
| Is This Answer Correct ? | 1 Yes | 5 No |
What is data type in database?
What is mutating table?
what are dynamic queries in t-sql? : Transact sql
Determine if oracle date is on a weekend?
Can a composite key be null?
Mention what problem one might face while writing log information to a data-base table in pl/sql?
what are null values? : Sql dba
What is insert command in sql?
What are the differences between Database Trigger and Integrity constraints ?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
what is check constraint? : Sql dba
how i do the database testing of online money transactions between two parties (client and organization). suppose our company makes a website for our client and give a extra feature of online money transaction with there clients then how i test this feature in database testing
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)