Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Variable selects in PL/SQL

Variable selects in PL/SQL

From: Dennis de Visser <dennisv_at_bart.nl>
Date: 1997/09/08
Message-ID: <5v1l7d$hfs@nosy.bart.nl>#1/1

Dear ORACLE users,

Can some one help me to create a variable select statement in PL/SQL.

I'm looking for a way to get the same result as the example ( SQL*Plus ), so it can be used in Forms.

COLUMN where1 NEW_VALUE where1 NOPRINT

SELECT DECODE('&1','%' ,NULL

                  ,'EAST','AND dept IN (''10'',''20'')'

                  ,'WEST','AND dept IN (''30'',''40'')'

                         ,NULL)       where1

FROM DUAL
;

SELECT ename

FROM emp

WHERE mng IS NOT NULL &where1

ORDER BY ename

;

I hope some of you got the answer.

Kind regards,

Dennis de Visser,
ORACLE programmer
Syntegra Netherlands
dennisv_at_bart.nl Received on Mon Sep 08 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US