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: assigning nulls to records

Re: assigning nulls to records

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 20 Jan 2004 18:24:41 -0800
Message-ID: <1074651810.971087@yasure>


Daniel Morgan wrote:

> Haximus wrote:
> 

>> The PL/SQL documentation for 9.2 states that "to set all the fields in a
>> record to null, simply assign to it an uninitialized record of the same
>> type" and gives the following example:
>>
>> DECLARE
>> TYPE EmpRec IS RECORD (
>> emp_id emp.empno%TYPE,
>> job_title VARCHAR2(9),
>> salary NUMBER(7,2));
>> emp_info EmpRec;
>> emp_null EmpRec;
>> BEGIN
>> emp_info.emp_id := 7788;
>> emp_info.job_title := 'ANALYST';
>> emp_info.salary := 3500;
>> emp_info := emp_null; -- nulls all fields in emp_info
>> ...
>> END;
>>
>> Is it acceptable to set fields in a record to null by assigning null
>> to the
>> record itself? Like:
>>
>> emp_info := null;
>>
>> I tried the syntax and it appears to work, I am just curious if this is
>> actually documented somewhere because I have been unable to find it.
> 
> 
> Absolutely.
> 

Methinks I pushed the Send button too quickly. I retract this statement until I can check it out.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Jan 20 2004 - 20:24:41 CST

Original text of this message

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