Home » SQL & PL/SQL » SQL & PL/SQL » Reset Record Object
Reset Record Object [message #186771] Wed, 09 August 2006 07:45 Go to next message
annagel
Messages: 220
Registered: April 2006
Senior Member
Is there any quick PL/SQL way to reset a record object? I know setting the object to null will 'clear' it, but I want to reinitialize it so I have my default values back. So resetting an object like this:

TYPE cs3_info IS RECORD (
      /*probably constants*/
      c_business_group_id             NUMBER (20)     := 0,
      c_employee_person_type_id       NUMBER (20)     := 3,
      c_db_date_format                VARCHAR2 (30)   := 'YYYY/MM/DD HH24:MI:SS',
      c_validate                      BOOLEAN         := TRUE,
      c_rehire_reason                 VARCHAR2 (9)    := 'CONV_TERM');


would give me all of these default values again rather than null everywhere.

Thanks
Andrew
Re: Reset Record Object [message #186782 is a reply to message #186771] Wed, 09 August 2006 08:49 Go to previous messageGo to next message
hobbes
Messages: 173
Registered: January 2006
Senior Member
You could create a new variable of the same record type, and assign it to the variable you want reinitialized.

Re: Reset Record Object [message #186798 is a reply to message #186782] Wed, 09 August 2006 11:02 Go to previous message
annagel
Messages: 220
Registered: April 2006
Senior Member
Didn't even think of that...it works obviously and definatly easier than the other option of manually resetting my values.

Andrew
Previous Topic: Data manipulation is not possible on views
Next Topic: Committing Large Amounts of Data
Goto Forum:
  


Current Time: Sat Apr 26 01:06:47 CDT 2025