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

Chapter 5. Records

Beginner

Q:

5-1.

The statements are:

  1. False. A record is not a scalar datatype, meaning that it contains only one piece of information. The whole point of a record is to contain multiple pieces of information: it is a composite datatype whose structure is much like a row in a database table.

  2. True.

  3. False. A record is not designed specifically to hold sounds, but you could (in Oracle8 and above) easily define a record with a LOB (large object) field that contains a sound file.

  4. False. It doesn’t make any sense to define a record based on a tablespace. You can, on the other hand, define a record that resembles a row in a table or row fetched by a cursor.

  5. True.

Q:

5-2.

Only the format shown in (c), called dot notation, can reference a field in a record. In general, you refer to an individual field in a record as record_name.field_name. You must always use the fully qualified name of a field when referencing that field.

Q:

5-3.

To define a table-based record, use the %ROWTYPE declaration attribute:

DECLARE
   ceo_rec ceos%ROWTYPE;

Q:

5-4.

The statements are:

  1. False. A table-based record takes its definition from the structure of a table: each field has the same name and datatype as each and every column in its associated table (not just the nonnumeric fields). To define a table-based record, declare it with the %ROWTYPE attribute (you can only use %TYPE with scalar variable declarations). Suppose the emp table is defined as follows:

    CREATE TABLE emp ( empno NUMBER, ename VARCHAR2(30), hiredate ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Oracle Database 12c PL/SQL Advanced Programming Techniques

Oracle Database 12c PL/SQL Advanced Programming Techniques

Michael McLaughlin, John Harper

Publisher Resources

ISBN: 9781449324070Errata Page