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: Why can't I use a INput parameter to make a update ?

Re: Why can't I use a INput parameter to make a update ?

From: Jomarlen <jomarlen_at_aol.com>
Date: 1997/11/15
Message-ID: <19971115014200.UAA14357@ladder02.news.aol.com>#1/1

> Imagine that profes is a parameter, then
>
>------------------------------------------
> UPDATE usuari u
> SET u.profes = profes
> WHERE u.nomrec = nomrec;
>------------------------------------------
> dosn't function, but
>
>------------------------------------------
> cadena char(30);
>
>begin
>
>cadena:=profes;
>
> UPDATE usuari u
> SET u.profes = cadena
> WHERE u.nomrec = nomrec;
>------------------------------------------
>
>works correctly !! Why ??
>
>

It doesn't work quite simply because profes is the name of your column and SQL is not going to look for any other meaning for it.

Good practice is to ALWAYS use p_XXXXXXX for parameter names, that way they are easily identifiable and you'll never fall into this trap.

  UPDATE usuari u

     SET u.profes = p_profes
   WHERE u.nomrec = nomrec;

Would work just fine.

John



John C. Lennon
Utility Partners Inc.
4300 West Tropicana Blvd LVO-UPL
Las Vegas NV 89103

FOR UTILITY PARTNERS EMPLOYMENT
OPPORTUNITIES VISIT www.utilpart.com

e-mail: jomarlen_at_aol.com
Web Site: http://members.aol.com/jomarlen/

The views expressed in this message
are those of the author and not
necessarily those of U.P. Inc.
and/or its employees.


Received on Sat Nov 15 1997 - 00:00:00 CST

Original text of this message

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