問題文
A procedure has to build a query whose table name comes from a parameter, and another part of the same procedure has to create a table. Which description of when dynamic SQL is needed is correct?
選択肢
- Dynamic SQL is needed when the text of the statement is not known while the unit is being compiled, and it is also needed for the statements that static SQL does not support at all, so both parts of the procedure need it.
- Dynamic SQL is needed when the statement reads more than one table, and it is also needed when the statement changes rows, so the query needs it while the creation of the table can be written as static SQL.
- Dynamic SQL is needed when the statement runs inside a loop, and it is also needed when the statement is written inside a package, so the query needs it while the creation of the table does not.
- Dynamic SQL is needed when the statement has to be checked at run time rather than at compile time, and static SQL is the choice when a table name comes from a parameter of the unit.