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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL with Decode problem

Re: PL/SQL with Decode problem

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 7 May 2003 08:55:12 GMT
Message-ID: <b9ahlg$h2ebu$1@ID-82536.news.dfncis.de>

> I am getting an error message when I try to assign the value of a
> decode query into a PL/SQL variable.
> The error seems to be caused by the decode's col/expression value
> which is another select statement.
>
> The error does NOT occur if I take out the select and just use a
> column name but I need to use the query.
> The code is as follows:
>
> DECLARE
>
> v_my_var varchar2(20);
>
> BEGIN
>
> select new_emp_code into v_my_var
> from(
> select distinct new_emp_code from(
> select decode((select distinct emp_code from
> emp_table), 'A', 'B',
> 'C') new_emp_code
> from emp;
>
> END;
  Your select statement has 4 opening paranthesis and only two closing ones.

Rene Nyffenegger

-- 
  Projektleitung und Entwicklung in Oracle/C++/C# Projekten
  http://www.adp-gmbh.ch/cv.html
Received on Wed May 07 2003 - 03:55:12 CDT

Original text of this message

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