What is dynamic SQl and how you will create and execute
dynamic sql?
Answers were Sorted based on User's Feedback
Answer / raksha
Dynamic SQL enables you to write programs that reference SQL statements whose full text is not known until runtime.
Below is the way to execute dynamic sql
EXECUTE IMMEDIATE 'SELECT d.id, e.name FROM dept_new d, TABLE(d.emps) e -- not allowed in static SQL
-- in PL/SQL
WHERE e.id = 1'
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / ravi singh
Dynamic SQL enables you to executes your SQL statement at run time on the basis of different conditions. They can be executed with the help of creating SQLs at run time. you can store your where clause or sql statements in variables and on the basis of requirements you can execute them.
Dynamic SQL comprises reference cursors.
for ex: open cursor for select a,b,c from table_name;
execute immediate 'select a,b from table_name'
you can store the result set into variables too.
| Is This Answer Correct ? | 2 Yes | 0 No |
How is debugging done?
What is nested table in pl sql?
What is the difference between the implicit and explicit cursors?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
What is the difference between CHAR and VARCHAR2? If VARCHAR2 serves the uses of CHAR why CHAR is still used and not been discarded yet?
what are different types of keys in sql?
How do I copy a table in sql?
What are the three pl sql block types?
What is java sql connection?
What is the difference between alter trigger and drop trigger statements?
Which is better join or inner query?
how to calculate expressions with sql statements? : Sql dba
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)