Re: PL/SQL Question for FORMS5.0

From: Bob Cunningham <bcunn_at_oanet.com>
Date: 1998/01/24
Message-ID: <34ca5cec.232429582_at_news.oanet.com>#1/1


On Fri, 23 Jan 1998 16:09:34 -0500, Frank Phillips <fwp_at_ufl.edu> wrote:

>In Forms5 I am attempting to write a PL/SQL procedure to dynamically
>populate pick lists. This is easy, but, I wish to include a where
>clause. The problem: When passing the variables to dynamically build the
>SQL code you must put single quotes around the variable. This does not
>work as PL/SQL uses the single quote as the delimiter for the string you
>must concatenate.
>
>Sql_code := ‘select ‘||list_field||’ from ‘||table_name||’where
>‘||where_field||’ = ‘||field_value;
>
>This code will not work as field_value must be quoted. I have played
>with several formats attempting to get the quotes in, all have failed.
>Any ideas??? Thanks for the help.
>
>

Try:
 Sql_code := 'select '||list_field||' from '||table_name   ||'where'||where_field||' = '''||field_value||'''';

Place 2 consecutive single quotes within a quoted string wherever you wish to have a single quote participate in the string.

Bob Cunningham
bcunn_at_oanet.com Received on Sat Jan 24 1998 - 00:00:00 CET

Original text of this message