Skip to Content
Oracle PL/SQL Programming: A Developer's Workbook
book

Oracle PL/SQL Programming: A Developer's Workbook

by Steven Feuerstein, Andrew Odewahn
May 2000
Intermediate to advanced
594 pages
11h 32m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL Programming: A Developer's Workbook

Intermediate

Q:

5-8.

The statements are:

  1. Valid. This reason, along with (c) and (e), is an excellent reason to define your own record TYPE and then declare records from that TYPE. With programmer-defined records, you can rely on any and all native PL/SQL datatypes. You are not restricted to the definitions of existing tables or cursors. And, in a record TYPE you can declare another record TYPE, or even a collection TYPE (index-by table, nested table, variable array).

  2. Invalid. Using programmer-defined records does not, on the other hand, result in PL/SQL code that is independent of Oracle and can be ported to SQL Server. PL/SQL is a language proprietary to Oracle.

  3. Valid.

  4. Invalid. This reason may reflect a real concern (“fear” may be a better word) in your development organization, but the solution to this problem is not an avoidance of the %ROWTYPE attribute. Perhaps a round of mud wrestling will do the trick.

  5. Valid.

Q:

5-9.

All these statements are true. A programmer-defined record takes its definition from a TYPE statement in which each field in the record (its name and datatype) is defined explicitly (kind of like a CREATE TABLE statement inside PL/SQL). To declare a programmer-defined record:

  • Use the TYPE statement to declare a record type: a general record structure that can be shared by multiple record instances.

  • Use the record type as a basis for declarations of actual records having that structure.

Here is an example of both these steps:

DECLARE TYPE summer_fun_rt IS RECORD ( favorite_ice_cream_flavor ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 11g PL/SQL Programming Workbook

Oracle Database 11g PL/SQL Programming Workbook

Michael McLaughlin, John Harper

Publisher Resources

ISBN: 9781449324070Supplemental ContentErrata Page