Re: HELP: SQL+ : How to use & in strings in PL/SQL scripts

From: Howard Bryden <100251.1711_at_CompuServe.COM>
Date: 21 Jan 2000 05:42:11 GMT
Message-ID: <868rjj$i6o$1_at_ssauraab-i-1.production.compuserve.com>


[Quoted] << ... or use chr(38) in place of & in the source. (eg: instead of 'Ben & Jerry', code 'Ben ' || chr(38) || ' Jerry'.... >> 
[Quoted] This should do just as well:

'Ben ' || '&' || ' Jerry'

[Quoted] At least it does under 7.3.4.

[Quoted] BTW, doyou know of a way where I can pass a DEFINEd string into the PL/SQL environment where that string could include single quotes? E.g.

define x = "&1"
declare xx varchar2(80);
begin

[Quoted]    xx := 'select whatever from table &x'; 
[Quoted] fails if &1 was something like "WHERE colname = 'value'" because of the quotes.


-- 
Oracle DBA / HPUX Sysadmin        | Rocky: "We're going to have 
Comalco Minerals & Alumina,       |  to think!"
Weipa, AUSTRALIA 4874             | Bullwinkle: "There must be
Tel 61-7-40698711 Fx.61-7-40698951|  an easier way than that."
Received on Fri Jan 21 2000 - 06:42:11 CET

Original text of this message