問題文
A block needs a variable that holds a customer name, a credit limit, and a date, and no table in the schema has exactly those three columns. Which approach declares that variable?
選択肢
- Declare the variable as an associative array indexed by string, because the three values can be stored under three keys and read back by those keys later in the same block.
- Declare the variable with the %ROWTYPE attribute against the table that has the greatest number of matching columns, because the extra fields of that row can be left unused during the run.
- Define a record type in the declarative part that lists the three fields with their data types, and then declare a variable of that type in the same part.
- Declare three separate scalar variables and pass them together to a subprogram as one parameter, because a record type can be defined against a table alone and not against a list of fields.