Chapter 20 Native Dynamic SQL


Lab 20.1 Self-Review Answers

A5:

Questions

Answers

Comments

1)

C

A dynamic SQL statement may contain either a SQL statement or a PL/SQL block.

2)

A

An INTO option of the EXECUTE IMMEDIATE statement is very similar to the INTO clause of a SELECT INTO statement. Recall that a static SELECT INTO statement is used only for single-row queries, and it generates a TOO_MANY_ROWS exception when there are multiple rows in the result set.

3)

B

Recall that you cannot pass names of schema objects to the dynamic SQL statements via bind arguments.

4)

B

 

5)

B

 

Lab 20.2 Self-Review Answers

A5:

Questions

Answers

Comments

1)

B

While the OPEN-FOR, FETCH, and CLOSE statements can be used for single-row queries, they are generally used for multi-row queries.

2)

A

The optional USING clause allows you to pass values to the dynamic SQL statement associated with the cursor at the run time.

3)

C

 

4)

B

 

5)

B

Data returned by the cursor can be fetched into a user-defined record as long as the structure of the record is similar to the structure of the result set. In other words, if a cursor returns first and last names, the user -defined record should contain at least two fields that can store character data.




Oracle PL[s]SQL by Example
Oracle PL[s]SQL by Example
ISBN: 3642256902
EAN: N/A
Year: 2003
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net