Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: using decode in procedure
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
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...Received on Wed Apr 10 2002 - 22:44:34 CDT
> 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