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: Help !!!ORA-06502: PL/SQL: numeric or value error: character to number conversion error

Re: Help !!!ORA-06502: PL/SQL: numeric or value error: character to number conversion error

From: Terry Dykstra <tddykstra_at_forestoil.ca>
Date: Tue, 28 Mar 2006 20:23:14 GMT
Message-ID: <SWgWf.12659$B_1.6551@edtnps89>


"JC" <joseph.chewning_at_targacept.com> wrote in message news:1143575430.436600.260740_at_j33g2000cwa.googlegroups.com...
> I get this error from the following line... Can anyone tell me why???
>
> colvalue number;
> mcn varchar(100);
> lotid number;
> mrn rowid;
>
> select mcn into colvalue from lotz where lot_id=lotid and rowid=mrn;
>
> I have tried this also
>
> Execute Immediate 'select '||mcn||' into '||colvalue||' from lotz where
> lot_id='||lotid||' and rowid='||mrn;
>
>
> Thanks,
>
> JC
>

you are selecting a varchar into a number. Can't do that. At minimum you would need a to_number(mcn).

-- 
Terry Dykstra
Canadian Forest Oil Ltd.
Received on Tue Mar 28 2006 - 14:23:14 CST

Original text of this message

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