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: Jaap W. van Dijk <j.w.vandijk.removethis_at_hetnet.nl>
Date: Thu, 05 Jun 2003 22:00:13 +0200
Message-ID: <ms7vdv8k842dn950721cd7ra63fc6nj58t@4ax.com>


With assignment statement I mean a statement like

v_department_id :=

                      CASE i
                              WHEN 1 THEN 10
                             WHEN 2 THEN 20
                              WHEN 3 THEN 50
                              WHEN 4 THEN 60
                              WHEN 5 THEN 80
                              WHEN 6 THEN 90
                              WHEN 7 THEN 110
                      END ;

so a statement with an assignment operator (:=). This is the statement the OP is using and which is incorrect, also in 9i.

The example that W. Breitner uses is an SQL-statement (although being an UPDATE it assigns a (possible new) value to a database column of course).

Jaap.

On Thu, 05 Jun 2003 14:04:04 +0000, W.Breitling <member28455_at_dbforums.com> wrote:

>
>CASE in an assignment is valid in 8i. My example was in an 8i instance.
>You just have to have the syntax right.
>
>Originally posted by Vladimir M. Zakharychev
>> "Jaap W. van Dijk" wrote in message
>> news:n2gsdv81e7162v0h3fkn5qekb0vq6qmgs1_at_4ax.com"]news:n2gsdv81e-
>> 7162v0h3fkn5qekb0vq6qmgs1_at_4ax.com[/url]...
>>
>> SQL and PL/SQL are two different beasts, so quoting SQL Reference
>> for PL/SQL question is not correct, even though they share the same
>> SQL engine in 9i. PL/SQL User's Guide and Reference has its own
>> section on CASE and that assignment statement is pretty valid, just
>> not in 8i, which was OP's source of the problem.
>>
>> --
>> Vladimir Zakharychev (bob_at_dpsp-yes.com) http://w-
>> ww.dpsp-yes.com/http://www.dpsp-yes.com
>> Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet
>> applications.
>All opinions are mine and do not necessarily go in line with those of my
>employer.
Received on Thu Jun 05 2003 - 15:00:13 CDT

Original text of this message

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