Intermediate

5-8.

A programmer-defined record is based on a record “type” you define within your code. Which of the following statements represent valid reasons for working with a programmer-defined record?

  1. You want a field in your record to be of type Boolean or some other datatype that is available in PL/SQL, but not in SQL.

  2. You want to write PL/SQL code that is independent of Oracle so it can be ported easily to other database vendor products such as SQL Server.

  3. The structure of the record you need, while consisting solely of SQL datatypes, does not match any table or cursor defined in your system.

  4. You don’t trust your table structures because the DBAs change them without notice, causing your programs to break.

  5. You want to avoid repetitive definitions of data structures by using nested records.

5-9.

Which of these statements about programmer-defined records are true, and which are false?

  1. The programmer-defined record gives the programmer tremendous flexibility and complete control over the number, names, and datatypes of fields in a record. It allows the creation of records that have nothing to do with either a table or cursor.

  2. You can declare fields to be NOT NULL, leaving it to the PL/SQL runtime engine to enforce your data integrity.

  3. A programmer-defined record can have as its field an index-by table, a programmer-defined subtype, another PL/SQL record type, or an object type.

  4. Working with programmer-defined records always involves two steps. First, define the record TYPE (which you must ...

Get Oracle PL/SQL Programming: A Developer's Workbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.