Re: local variable/column name conflict?

From: Mungo Henning <mungoh_at_itacs.strath.ac.uk>
Date: Fri, 21 May 1999 12:37:55 +0100
Message-ID: <37454593.7E942CAD_at_itacs.strath.ac.uk>


Bert Scalzo wrote:

> Never do this. PL/SQL order of precedence is column names first during
> parse resolution. SO this will always return all rows. This is a common
> PL/SQL mistake. Oracle education recommends in their training to
> prefix all var names with v_

Agreed. Methinks the sentiment is to prefix variables with "v_", prefix constants with "c_" and NEVER use either prefix for table names nor column names.
IIRC the pecking-order is firstly column names, then PL/SQL names THEN table names.
Dunno why this last bit applies - perhaps there's some conflict with regard to the dot notation (is "a.b" a reference to column "b" off table "a" or field "b" off record-variable "a") - clarification anyone?

HTH Mungo

--
Mungo Henning - it's a daft name but it goes with the face...
mungoh_at_itacs.strath.ac.uk.http://www.itacs.strath.ac.uk/
(since everyone else does it) I speak for me, not my employer.
Received on Fri May 21 1999 - 13:37:55 CEST

Original text of this message