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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL help needed

Re: PL/SQL help needed

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Fri, 06 Aug 1999 16:14:30 -0400
Message-ID: <37AB4225.4EA0A981@Unforgettable.com>


I stand by my code. The use of 'I' is something that is univerally understood by most experienced programmers and its usage is extremely obvious - it also has a historical significance which is part of the lore of programming and has been around since at least the days of FORTRAN. What you may not undertand is that 'I' represents an aggregate record, the members of which are determined by the SELECT statement in the cursor definition. Using 'policy_number' as the name of the record would be extremely misleading and could be mistakenly interpreted as actually representing a policy number whereas someone who saw 'I' (and who also actually knew PL/SQL) would never make that mistake. I probably could have used 'policy_rec' just as easily, but I was writing a quick example to illustrate how a particular technique could be handled. The user of the example would be responsible for maintaining their own naming convention. I also didn't include all of the error detection that I would normally include in a production program - but you didn't catch that did you?

Gygy Berlogea wrote:

> Here we have a summary of the PREVIOUS solutions.
> Please note the naming convention used for the cursor variable "i" (
> previously "policy_number" ) this, in it's own length, would consume
> most Oracle resources, and there's always a chance that someone might
> be able to read and understand this code (!!!).
>
> Kenneth C Stahl wrote in message
> <379DC9B7.8A652258_at_Unforgettable.com>... Yee gads, how did
> you ever come up with this code?
>
> If you want to update specific rows, do it like this:
> Declare
> CURSOR some_policies IS
> SELECT p.policy_number,
> p.policy_date_time
> p.rowid
> FROM policy p,
> register_cur rc
> WHERE p.policy_number = rc.policy_number
> AND p.renewal_code = 1
> AND rc.status_1 = 5;
> BEGIN
> /* etc */
>
> END;
>
Received on Fri Aug 06 1999 - 15:14:30 CDT

Original text of this message

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