Re: pl/sql: test if record is empty

From: Donkey Hot <spam_at_plc.is-a-geek.com>
Date: 29 May 2008 18:28:13 GMT
Message-ID: <Xns9AADDA689F43BSH15SGybs1ysmajw54s5@194.100.2.89>


steph <stephan0h_at_yahoo.de> wrote in
news:76d293f6-0d3f-4968-94a7-9e18613a2339_at_s50g2000hsb.googlegroups.com:

>> > Similarily, how can I empty a record? Do I need to empy all of it's
>> > components like:
>>
>> > declare
>> > o_rec mytab%ROWTYPE;
>> > begin
>> > o_rec.empno:=null;
>> > o_rec.empname:=null;
>> > ...
>> > end;
>>
>> > cheers,- Hide quoted text -
>>
>> > - Show quoted text -
>>
>> Steph,
>> Just set the ROWTYPE variable to null:
>> o_rec := NULL;
>>
>> Regards,
>> Vince

> 
> you're right. of courese this works. silly me ...
> thanks
> 

Really?

What happens with code?

    	declare
    	  o_rec mytab%ROWTYPE;
    	begin
    	  o_rec := null ;
    	  o_rec.empno:=null;    	-- null pointer exception?
    	  o_rec.empname:=null;
    	  ...
    	end;

If the o_rec "points" to null, how can it's attributes be accessed? I guess they can not. Received on Thu May 29 2008 - 13:28:13 CDT

Original text of this message