pl/sql forcing RHS of = in where clause to be variable?

From: <>
Date: Tue, 01 Jul 2008 20:59:38 GMT
Message-ID: <_Uwak.431$>

This code will compare a column to a variable:

declare myx number;
  select * from foo where x=myx;

but suppose I have a variable with the same name as a column:

declare x number;
  select * from foo where x=x;

This will compare column x with column x, and not with the variable x, right? Is there syntax to force the rightmost x to be a variable? Or should I do

  myx := x;
  select * from foo where x=myx;

This is in the context of a parameter name of a public function, so I don't want to do the obvious choice of renaming the variable.

Many TIA!

Mark Harrison
Pixar Animation Studios
Received on Tue Jul 01 2008 - 15:59:38 CDT

Original text of this message