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: using decode in procedure

Re: using decode in procedure

From: Roman Mirzaitov <rmirzaitov_at_kt.kg>
Date: Thu, 11 Apr 2002 09:44:34 +0600
Message-ID: <a930r7$10qe9p$1@ID-127142.news.dfncis.de>


Hi,

it isn't a matter of DECODE or other fuction. If you use SELECT statement inside a PL/SQL block you have to catch selected values into some variables for futher processing.
Modify you statement like this:
Select decode (a.Description, 'Company
Wide','Corporate',a.Description) Parent_Organisations,

      c.Description Divisions,
      c.Code Division_Codes

into v_parent_org, v_divisions, v_div_codes <so on>
And don't forget to describe these vars before using.

Regards,

--
Roman Mirzaitov
Brainbench MVP for Oracle Administration
www.brainbench.com

"Paul Fell" <novaweb_at_iinet.net.au> wrote in message
news:4b270a4e.0204101856.49287f0b_at_posting.google.com...

> Oracle 9i
>
> I want to use the following :
>
> Select decode (a.Description, 'Company
> Wide','Corporate',a.Description) Parent_Organisations,
> c.Description Divisions,
> c.Code Division_Codes
> from tblLUBusinessGroup a
> INNER JOIN tblDivisionLink b ON b.Business_Group_Code = a.Code
> LEFT JOIN tblLUDivision c ON c.Code = b.Division_Code
> Order By a.Description, c.Description;
>
> This same code works in SQL*Plus, but when I try to compile in a
> procedure I get the error message :
>
> "PLS-00428: an INTO clause is expected in this SELECT statement"
>
> The decode is meant to return 'Corporate' where the value is 'Company
> Wide' otherwise default to the value of the field.
>
> Any help much appreciated.
>
> thanks
> Paul
Received on Wed Apr 10 2002 - 22:44:34 CDT

Original text of this message

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