Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Using PLSQL Records.....

Re: Using PLSQL Records.....

From: Martin Doherty <martin.doherty_at_undisclosed.com>
Date: Fri, 24 Feb 2006 17:19:49 -0500
Message-ID: <2ULLf.39$BK.285@news.oracle.com>


Miggins wrote:

>Each,
>
>Am considering using plsql records purely to group related variables
>together in my package. For example i may have variables to do with
>subscribtions so would create the following
>
>TYPE r_subs_rec IS RECORD (sub_date date,
> sub_amt number
>(6,2),
> sub_number integer);
>
>Instead of just creating three seperate variables......its just for
>ease of finding things and also tidyness.
>
>Anyone think this is a bad/good idea? Should I not use records for this
>reason?
>
>Cheers
>
>
>

Seems like a good idea to me. The record fields should hold values that describe the attributes of an instance of an entity, or put another way the current values of the record fields should be related in that they describe the same logical object, e.g. the amount, date and number of a particular financial transaction. It would not make sense if you store the amount of transaction A, and the date of transaction B, in the same record.

Records also make perfect sense when they correspond with rows in database tables ... %ROWTYPE

Martin Received on Fri Feb 24 2006 - 16:19:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US