Unix Technical Forum

Ora-6502 Error in assigining value to varchar2 out param

This is a discussion on Ora-6502 Error in assigining value to varchar2 out param within the Oracle Database forums, part of the Database Server Software category; --> hi, I ve the following proc: 1 create or replace procedure checkit(a out varchar2) as 2 begin 3 a ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 06:37 AM
debashish.majumdar@gmail.com
 
Posts: n/a
Default Ora-6502 Error in assigining value to varchar2 out param

hi,
I ve the following proc:

1 create or replace procedure checkit(a out varchar2) as
2 begin
3 a := 'Deb';
4* end;

When i execute this SP i am greeted by the following error:

SQL> exec checkit(:a1);

BEGIN checkit(:a1); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number
conversion error
ORA-06512: at line 1


It wd be gr8 if anyone could help me in this. Sorry for asking such
a basic question.

Thanks in advance
Deb

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 06:37 AM
Rene Nyffenegger
 
Posts: n/a
Default Re: Ora-6502 Error in assigining value to varchar2 out param

On 2006-08-27, debashish.majumdar@gmail.com <debashish.majumdar@gmail.com> wrote:
> hi,
> I ve the following proc:
>
> 1 create or replace procedure checkit(a out varchar2) as
> 2 begin
> 3 a := 'Deb';
> 4* end;
>
> When i execute this SP i am greeted by the following error:
>
> SQL> exec checkit(:a1);
>
> BEGIN checkit(:a1); END;
>
> *
> ERROR at line 1:
> ORA-06502: PL/SQL: numeric or value error: character to number
> conversion error
> ORA-06512: at line 1
>
>
> It wd be gr8 if anyone could help me in this. Sorry for asking such
> a basic question.
>
> Thanks in advance
> Deb


The problem is not the procedure, it's the type of the bound variable
that you pass to the function. It seems to be a number type instead
of a character type.

RENE> variable f number
RENE> exec checkit(:f)
BEGIN checkit(:f); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 1


But if the bound variable is a varchar2, it works:

RENE> variable f varchar2(10)
RENE> exec checkit(:f)

PL/SQL procedure successfully completed.

RENE> print f

F
------------------------------------------------
Deb

--
Rene Nyffenegger
http://www.adp-gmbh.ch/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-25-2008, 06:37 AM
debashish.majumdar@gmail.com
 
Posts: n/a
Default Re: Ora-6502 Error in assigining value to varchar2 out param

Hi,
This Sp is modified a little. The same problem is still there.

1 create or replace procedure checkit(a out varchar2) as
2 begin
3 a := 'Deb';
4* end;
SQL> var b varchar2
SQL> exec checkit(:b);
BEGIN checkit(:b); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too
small
ORA-06512: at "XXKMA_PPS_30.CHECKIT", line 3
ORA-06512: at line 1


Thanks in advance
Deb

Rene Nyffenegger wrote:
> On 2006-08-27, debashish.majumdar@gmail.com <debashish.majumdar@gmail.com> wrote:
> > hi,
> > I ve the following proc:
> >
> > 1 create or replace procedure checkit(a out varchar2) as
> > 2 begin
> > 3 a := 'Deb';
> > 4* end;
> >
> > When i execute this SP i am greeted by the following error:
> >
> > SQL> exec checkit(:a1);
> >
> > BEGIN checkit(:a1); END;
> >
> > *
> > ERROR at line 1:
> > ORA-06502: PL/SQL: numeric or value error: character to number
> > conversion error
> > ORA-06512: at line 1
> >
> >
> > It wd be gr8 if anyone could help me in this. Sorry for asking such
> > a basic question.
> >
> > Thanks in advance
> > Deb

>
> The problem is not the procedure, it's the type of the bound variable
> that you pass to the function. It seems to be a number type instead
> of a character type.
>
> RENE> variable f number
> RENE> exec checkit(:f)
> BEGIN checkit(:f); END;
>
> *
> ERROR at line 1:
> ORA-06502: PL/SQL: numeric or value error: character to number conversion error
> ORA-06512: at line 1
>
>
> But if the bound variable is a varchar2, it works:
>
> RENE> variable f varchar2(10)
> RENE> exec checkit(:f)
>
> PL/SQL procedure successfully completed.
>
> RENE> print f
>
> F
> ------------------------------------------------
> Deb
>
> --
> Rene Nyffenegger
> http://www.adp-gmbh.ch/


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 06:37 AM
Rene Nyffenegger
 
Posts: n/a
Default Re: Ora-6502 Error in assigining value to varchar2 out param

On 2006-08-27, debashish.majumdar@gmail.com <debashish.majumdar@gmail.com> wrote:
> Hi,
> This Sp is modified a little. The same problem is still there.
>
> 1 create or replace procedure checkit(a out varchar2) as
> 2 begin
> 3 a := 'Deb';
> 4* end;
> SQL> var b varchar2
> SQL> exec checkit(:b);
> BEGIN checkit(:b); END;
>
> *
> ERROR at line 1:
> ORA-06502: PL/SQL: numeric or value error: character string buffer too
> small
> ORA-06512: at "XXKMA_PPS_30.CHECKIT", line 3
> ORA-06512: at line 1



No, it's not the SAME problem, now you have 'character string buffer
too small', yet, you had 'character to number conversion error':


>
>> > ERROR at line 1:
>> > ORA-06502: PL/SQL: numeric or value error: character to number
>> > conversion error
>> > ORA-06512: at line 1



When I declared the bind variable, I made it
varchar2(10), you forgot the (10):
>>
>> RENE> variable f varchar2(10)
>> RENE> exec checkit(:f)
>>
>> PL/SQL procedure successfully completed.
>>
>> RENE> print f
>>
>> F
>> ------------------------------------------------
>> Deb



hth,
Rene

--
Rene Nyffenegger
http://www.adp-gmbh.ch/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-25-2008, 06:37 AM
debashish.majumdar@gmail.com
 
Posts: n/a
Default Re: Ora-6502 Error in assigining value to varchar2 out param

oops. I was a little careless. Thanks a lot for replying.


Rene Nyffenegger wrote:
> On 2006-08-27, debashish.majumdar@gmail.com <debashish.majumdar@gmail.com> wrote:
> > Hi,
> > This Sp is modified a little. The same problem is still there.
> >
> > 1 create or replace procedure checkit(a out varchar2) as
> > 2 begin
> > 3 a := 'Deb';
> > 4* end;
> > SQL> var b varchar2
> > SQL> exec checkit(:b);
> > BEGIN checkit(:b); END;
> >
> > *
> > ERROR at line 1:
> > ORA-06502: PL/SQL: numeric or value error: character string buffer too
> > small
> > ORA-06512: at "XXKMA_PPS_30.CHECKIT", line 3
> > ORA-06512: at line 1

>
>
> No, it's not the SAME problem, now you have 'character string buffer
> too small', yet, you had 'character to number conversion error':
>
>
> >
> >> > ERROR at line 1:
> >> > ORA-06502: PL/SQL: numeric or value error: character to number
> >> > conversion error
> >> > ORA-06512: at line 1

>
>
> When I declared the bind variable, I made it
> varchar2(10), you forgot the (10):
> >>
> >> RENE> variable f varchar2(10)
> >> RENE> exec checkit(:f)
> >>
> >> PL/SQL procedure successfully completed.
> >>
> >> RENE> print f
> >>
> >> F
> >> ------------------------------------------------
> >> Deb

>
>
> hth,
> Rene
>
> --
> Rene Nyffenegger
> http://www.adp-gmbh.ch/


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-25-2008, 06:37 AM
Acme Acmeson
 
Posts: n/a
Default Re: Ora-6502 Error in assigining value to varchar2 out param


<debashish.majumdar@gmail.com> wrote in message
news:1156694064.335058.291960@i42g2000cwa.googlegr oups.com...
> oops. I was a little careless. Thanks a lot for replying.
>
>
> Rene Nyffenegger wrote:
>> On 2006-08-27, debashish.majumdar@gmail.com
>> <debashish.majumdar@gmail.com> wrote:
>> > Hi,
>> > This Sp is modified a little. The same problem is still there.
>> >
>> > 1 create or replace procedure checkit(a out varchar2) as
>> > 2 begin
>> > 3 a := 'Deb';
>> > 4* end;
>> > SQL> var b varchar2
>> > SQL> exec checkit(:b);
>> > BEGIN checkit(:b); END;
>> >
>> > *
>> > ERROR at line 1:
>> > ORA-06502: PL/SQL: numeric or value error: character string buffer too
>> > small
>> > ORA-06512: at "XXKMA_PPS_30.CHECKIT", line 3
>> > ORA-06512: at line 1

>>
>>
>> No, it's not the SAME problem, now you have 'character string buffer
>> too small', yet, you had 'character to number conversion error':
>>
>>
>> >
>> >> > ERROR at line 1:
>> >> > ORA-06502: PL/SQL: numeric or value error: character to number
>> >> > conversion error
>> >> > ORA-06512: at line 1

>>
>>
>> When I declared the bind variable, I made it
>> varchar2(10), you forgot the (10):
>> >>
>> >> RENE> variable f varchar2(10)
>> >> RENE> exec checkit(:f)
>> >>
>> >> PL/SQL procedure successfully completed.
>> >>
>> >> RENE> print f
>> >>
>> >> F
>> >> ------------------------------------------------
>> >> Deb

>>
>>
>> hth,
>> Rene
>>
>> --
>> Rene Nyffenegger
>> http://www.adp-gmbh.ch/

>


Eeeh, passing on an input parm to a procedure having only an output parm ?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com