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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: is this a good practice...pl/sql question

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

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Wed, 17 Sep 2003 13:59:40 -0800
Message-ID: <F001.005D0416.20030917135940@fatcity.com>


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-----
Sent: Wednesday, September 17, 2003 5:45 PM To: Multiple recipients of list ORACLE-L

> 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: smcclure_at_usscript.com

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: ListGuru_at_fatcity.com (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).




-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jamadagni, Rajendra INET: Rajendra.Jamadagni_at_espn.com 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: ListGuru_at_fatcity.com (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).

Received on Wed Sep 17 2003 - 16:59:40 CDT

Original text of this message

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