フリー問題

Oracle Database Program with PL/SQL のフリー問題 11 / 20 問目

問題文

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?

選択肢

  1. 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.
  2. 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.
  3. 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.
  4. 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.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。