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 |
what are the differences among these table level lock modes - IN SHARE MODE, IN SHARE UPDATE MODE, IN EXCLUSIVE MODE ?
What is the use of index in sql?
What are packages in pl sql and also explain its advantages?
Differentiate between % rowtype and type record.
What is the use of <> sql?
write the Sql query for creating database backup?
Is mariadb nosql?
Does sqlite need a server?
Can procedure in a package be overloaded?
What is a relationship and what are they?
What is procedure and function in sql?
can a stored procedure call itself or recursive stored procedure? : Sql dba