Re: PL/SQL Question for FORMS5.0

From: Ken Shirey <kshirey_at_commercial-data.com>
Date: 1998/01/28
Message-ID: <01bd2c1b$5efd0020$c7e940c6_at_kshirey>#1/1


Not so much fun to code, but still possible. 2 main ways to do this:

 aqry :=
'Select column_values
from tables
where a.column_a = b.column_b
and a.id = '
|| thisval || ' and a.other_id = '
|| to_char(otherVal) || ' group by a,b';

OR

use CHR(39) in your statements instead of the actual single quote.

Hope this helps...
Ken

Frank Phillips <fwp_at_ufl.edu> wrote in article <34C9070E.1F25B991_at_ufl.edu>...
> 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.
>
>
>
Received on Wed Jan 28 1998 - 00:00:00 CET

Original text of this message