Re: Forms3.0 Order by

From: Michael P. Stein <mstein_at_access.digex.net>
Date: 19 Nov 1993 10:42:03 -0500
Message-ID: <2cipgb$5s2_at_access.digex.net>


In article <AAX9mwi8N1_at_sg2.kbv>, Alex Novicky <oracle_at_vostok.marine.su> wrote:
>
>Becky, you can handle user defined dynemic ORDER BY like this:
>
>ORDER BY DECODE(:control.flag,'N',name,'A',address,'Z',zipcode,...,code)
 .
>where :control.flag is a displayed form field in a control block which can
>be set by user (with some redefined KEY-... trigger), and 'name',
>'address', 'zipcode', ... and 'code' are sample fields' names in sample
>table. Note that 'ORDER BY code' is a default ORDER BY.

    I don't think this works in 3.0, and I *know* it doesn't work in 2.3 because I tried it long ago. The problem is that Forms does not expect the ORDER BY clause to contain form field references, so it leaves ':control.flag' untranslated, resulting in a 'not all variables bound' error. With some finagling this can be made to work by putting some reference to ':control.flag' at the beginning of the WHERE clause and replacing the reference in the ORDER BY with ':1'. (If you know OCI you'll understand what's going on here.)

-- 
Mike Stein			The above represents the Absolute Truth.
POB 10420			Therefore it cannot possibly be the official
Arlington, VA  22210		position of my employer.
Received on Fri Nov 19 1993 - 16:42:03 CET

Original text of this message