Title: RE: is this a good practice...pl/sql question

Yes it is a good practice when required.

Raj
--------------------------------------------------------------------------------
Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !


-----Original Message-----
From: Steve McClure [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 17, 2003 5:45 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: is this a good practice...pl/sql question


>   Keeping aside all considerations about the loop, I see no problem
>here. The cursor variable is just short-hand notation for defining a
>table%ROWTYPE - you are not modifying some hidden Oracle internal state
>if this is what you are fearing. No 'mutating cursor', if I guess you
>correctly.

  I guess I am really wondering if it is a good practice to modify the
attributes of a record previously selected via a cursor.  It is not just a
typical variable that is defined and used in a manner that suits the
algorithm.  I am just wondering if it would be a better idea to treat this
type of a record as a constant.  To elevate it conceptually.  The reason
being that it does(should?)represent what was actually selected from the
database.  If another developer, or myself for that matter, were to come
along at a later date, and use that attribute in another section of code not
knowing, or forgetting, it had been altered above.  I have actually used
this technique extensively in a couple of routines more complex than the one
I have described above.  It was just as I made this little code change, I
felt a pang of conscience, and wanted to ask this philosophical question.

  I am not worried about mucking up the database, or any such thing.  I am
aware that variable is just like any other attribute in any record I might
have explicitly created myself.  It is just that since the database
instantiated this record to represent the results of my query, I am
wondering if it should grant it an elevated postition.

Sorry for rambling on and on etc.

Steve


--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Steve McClure
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

********************************************************************This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*********************************************************************1

Reply via email to