Select the best answer to complete this variable declaration for a record. DECLARE l_foo_table SOME_TABLE_________; BEGIN ...
-
%ROWTYPE
-
%TABLE
-
%COLUMNTYPE
-
%TYPE
-
None of the above
Declaring a PL/SQL record variable based on the entire column structure of a table uses %ROWTYPE. The %TYPE attribute is for declaring variables based on a single table column or another variable, while %TABLE and %COLUMNTYPE are invalid attributes.
To complete the variable declaration for a record, the correct answer is A) %ROWTYPE.
Explanation:
When declaring a variable for a record in PL/SQL, you can use the %ROWTYPE attribute to associate the variable with a table's structure. The %ROWTYPE attribute allows you to declare the variable based on the structure of a specific table. This means that the variable will have the same attributes and datatypes as the columns in the table.
In the given code snippet, the variable l_foo_table should be declared as a record associated with the structure of a table. Therefore, the correct syntax to complete the variable declaration is:
DECLARE l_foo_table table_name%ROWTYPE;
By using %ROWTYPE, the variable l_foo_table will have the same attributes and datatypes as the columns in the table_name table.