Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL help needed
And again,
There seems to be a tight relation between FORTRAN and posting solutions = already given by others.
One could understand at times, how someone can be proud for =
understanding
some of the most complex programming concepts like RECORDS for instance.
We seem a bit worried by the AGGREGATION stuff,
is it possible this has anything to do with FORTRAN ?
This ERROR DETECTION think is it like a device or something ?
The Observer
Kenneth C Stahl wrote in message =
<37AB4225.4EA0A981_at_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?
The Observer 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 Tue Aug 10 1999 - 11:28:55 CDT
![]() |
![]() |