Re: using parameters in PL/SQL

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Sun, 21 Jan 2001 00:32:39 -0800
Message-ID: <3A6A9EA7.B1041BFF_at_exesolutions.com>


> I have a procedure which accepts two parameters. I would like to use of
> the parameters, which is varchar2, in a select statement for a cursor.
> The name of the parameter is ffid. My select statement is:
>
> CURSOR map_cur IS
> SELECT ARID.INSTALLATION.INSTALLATION_NAME,
> ARID.INSTALLATION.FFID,
> REPLACE(ARID.ARID_MAPS.MAP_RANGE_STATUS,'*',NULL) as Status,
> ARID.ARID_MAPS.UPDATE_BY,
> TO_CHAR(ARID.ARID_MAPS.UPDATE_DATE,'YYYYMMDD') as UpdateDate,
> ARID.ARID_MAPS.INSTALLATION_SCANNED_MAP
> FROM ARID.ARID_MAPS, ARID.INSTALLATION
> WHERE ARID.ARID_MAPS.INSTALLATION_ID =
> ARID.INSTALLATION.INSTALLATION_ID
> AND ARID.INSTALLATION.FFID = ffid ;
>
> I want to use the ffid in the where clause as above. How do I get the
> quotes around ffid.

[Quoted] Why would you want to?

A SQL statement using a VARCHAR2 variable is a string by definition. No [Quoted] single-quotes are required.

I think your problem is poor variable naming. You should NEVER name a variable with the same name as an object in your database ... in this case a [Quoted] field. Rename it to ffid_txt or v_ffid or something else and it should work [Quoted] just fine.

Daniel A. Morgan Received on Sun Jan 21 2001 - 09:32:39 CET

Original text of this message