1Z0-149 practice question 9 of 15
Which three SQL statements, embedded in PL/SQL, typically benefit from using variables declared with %ROWTYPE? (Choose three.)
Full set: 65 questionsThe %ROWTYPE attribute creates a record variable that can hold an entire row from a table or view. It is most beneficial for DML statements that operate on entire rows. SELECT INTO ... can fetch a complete row into a %ROWTYPE variable (D). INSERT can use a %ROWTYPE variable to insert a complete row with the VALUES clause (G). UPDATE can use a %ROWTYPE variable to update multiple columns in a row at once using the SET ROW clause (C). These statements are simplified by treating the row as a single unit.
A. CREATE Incorrect. CREATE is a DDL statement that defines database objects; it does not operate on rows of data.
B. DROP Incorrect. DROP is a DDL statement that removes database objects; it does not operate on rows of data.
E. DELETE Incorrect. DELETE typically operates on rows identified by a key in the WHERE clause and does not directly use the full row structure provided by %ROWTYPE in the statement itself.
F. ALTER Incorrect. ALTER is a DDL statement that modifies database objects; it does not operate on rows of data.
1. Oracle Database PL/SQL Language Reference, 23c. Section 3.8.1, "Declaring Items Using the %ROWTYPE Attribute". This section explicitly shows examples of using %ROWTYPE with SELECT INTO, INSERT, and UPDATE SET ROW.
2. Oracle Database PL/SQL Language Reference, 23c. Section 6.4.3, "UPDATE Statement". It documents the SET ROW clause, which "assigns the values of a record variable to a row."
3. Oracle Database PL/SQL Language Reference, 23c. Section 6.4.2, "INSERT Statement". It shows an example of INSERT INTO ... VALUES (recordvariable).
Keep practicing
Take the free 1Z0-149 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-149 practice questions
- Question 3Which two PL/SQL elements can be deprecated using the DEPRECATE pragma? (Choose two.)
- Question 5Which two statements are true about using the OR REPLACE clause when creating named subpr…
- Question 6Which three are true about functions and procedures? (Choose three.)
- Question 8Which two are true about the PLSQL_CODE_TYPE parameter? (Choose two.)
- Question 11SERVEROUTPUT is enabled. Which code block will display the values from 1 to 10 in descend…
- Question 15SERVEROUTPUT is enabled. Which is the correct method to use a PACKAGED CONSTANT in SELECT…
