Re: SQL*Forms 3.0 and Referencing

From: Michael P. Stein <mstein_at_access.digex.net>
Date: 19 Nov 1993 11:28:22 -0500
Message-ID: <2cis76$gtr_at_access.digex.net>


>I don't understand how this works - but would like to know as I would
>find it useful. E.G. you can't mean something like ....
>
>DECLARE
> VAR_NAME CHAR(10);
>BEGIN
> VAR_NAME := 'SYSDATE';
> SELECT VAR_NAME INTO :JUNK_DATE FROM DUAL;
>END;
>
>...that doesn't work. How do you reference the contents of VAR_NAME in
>the select statement ? (PL/SQL v1.0)

    As long as the datatypes are the same, you can use the DECODE function:

    SELECT DECODE( VAR_NAME, 'SYSDATE', SYSDATE, ... ) ... You'll probably have to do a lot of TO_CHAR conversions if your possible selection items aren't all CHAR.

-- 
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 - 17:28:22 CET

Original text of this message