Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: local variable/column name conflict?
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@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 - 06:37:55 CDT