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 -> Re: CASE strucrure in PL/SQL

Re: CASE strucrure in PL/SQL

From: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Fri, 06 Jun 2003 00:24:56 +0200
Message-ID: <2ogvdv07ah5b97mk3dbq49p5qg4jv6s18p@4ax.com>


On Thu, 05 Jun 2003 21:18:11 +0000, W.Breitling <member28455_at_dbforums.com> wrote:

>
>ora92.scott> DECLARE
> 2 v_department_id number;
> 3 BEGIN
> 4 FOR i IN 1..7 LOOP
> 5 select case when i=1 then 10
> 6 else case when i=2 then 20
> 7 else case when i=3 then 30
> 8 else case when i=4 then 40
> 9 else case when i=5 then 50
> 10 else case when i=6 then 60
> 11 else case when i=7 then 70
> 12 end end end end end end end
> 13 into v_department_id
> 14 from dual;
> 15 dbms_output.put_line(i||' - '||v_department_id);
> 16 end loop;
> 17 end;
> 18 /
>1 - 10
>2 - 20
>3 - 30
>4 - 40
>5 - 50
>6 - 60
>7 - 70
>
>PL/SQL procedure successfully completed.

Why hardcoding this crap if you can put it in one pl/sql table and forget about it. Is no one learning appropiate coding techniques anymore? Looks like

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Thu Jun 05 2003 - 17:24:56 CDT

Original text of this message

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