Re: 'Dynamic IN'-statement in Forms 4.5
Date: 1995/06/26
Message-ID: <glasstetter.89.000B8664_at_bmcwest.com>#1/1
In article <DAs70z.4Hv_at_rivm.nl> Rene.Hoekstra_at_rivm.nl (Rene Hoekstra) writes:
>From: Rene.Hoekstra_at_rivm.nl (Rene Hoekstra)
>Subject: 'Dynamic IN'-statement in Forms 4.5
>Date: Mon, 26 Jun 1995 19:12:21 GMT
>Hi There,
>I have the following problem :
>I have two forms; one where I select a couple of records from which I want to
>display details in the second one.
>I pass the key-values of the selected records as a comma-separated list via a
>global variable to the second
>form. In this second form I use the block 'WHERE-clause' as follows:
>WHERE to_char(<column_name>) in (<global.variable>)
>I have to use the 'to_char' conversion function because I have to define the
>global variable as a character-string.
>However if I do this, Oracle Forms puts the entire variable (and thus the entire
>comma-separated list) between single-
>quotes and my query returns no rows.
>Does anyone know a way to solve this problem ??? I've tried to put the values in
>the list in quotes, but then forms doubles
>the number of quotes, so that doesn't work either.
>Please help !!!!
>Rene.
>============================================================
>| Rene Hoekstra
>| E-Mail : Rene.Hoekstra_at_rivm.nl
>| National Institute of Public Health and Environmental
>| Protection (R.I.V.M.)
>| Bilthoven, The Netherlands
>============================================================
> " Don't mistake lack of talent for genius "
>============================================================
I ran a quick test, and this seemed to work (as one possible solution) :
In a WHEN-NEW-FORM-INSTANCE trigger :
:global.whereclause := 'WHERE LOC_name in (''Boise'',''Emmett'')'; Set_Block_Property('JUNK',DEFAULT_WHERE,:global.whereclause);
Of course, your global will be set in a calling form.
NOTE : Boise and Emmett are enclosed by 2 single quotes, not 1 double quote.
leave the enclosing quotes off if dealing with numeric data.
Hope this helps.
Dan Glasstetter
BMC West Corp.
Boise, ID
glasstetter_at_bmcwest.com
Received on Mon Jun 26 1995 - 00:00:00 CEST