Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL - Selecting by field with & in it
Try
SQL.Text := 'SELECT * FROM PHONEBOOK WHERE SEARCHKEY = ''O''''Riley & Smith''';
Does the O'Riley need to be four single quotes because it is first parsed by delphi then Oracle.
Christopher Latta wrote:
> I'm trying to run a select statement through Delphi 4 C/S to Oracle 8 like:
>
> SQL.Text := 'SELECT * FROM PHONEBOOK WHERE SEARCHKEY = ''O''Riley &
> Smith''';
>
> That is, the search value is:
>
> O'Riley & Smith
>
> I'm getting a "missing right quote" error. I have isolated this to the
> ampersand, as this is used in Oracle 8 to allow interactive queries, where
> the query prompts you for values before creating the row.
>
> Is there any way to select on such a value? Double ampersands don't work....
>
> Christopher Latta
Received on Tue Mar 16 1999 - 03:24:15 CST