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: PL/SQL help needed (newbie)

Re: PL/SQL help needed (newbie)

From: Mark Gumbs <mgumbs_at_nospam.hotmail.com>
Date: Wed, 26 May 1999 13:30:31 +0100
Message-ID: <374be730.0@145.227.194.253>


Almost forgot.

Not being a perl expert...

>my %sth = $dbh->prepare(q{
> BEGIN
> myproc(totalamt => :totalamt);
> END;
> });
>
>$sth->bind_param_inout(":totalamt",\$totalamt,10);

Check your declaration of totalamt in your perl script. If it cannot handle the size of the value returned from the procedure, it will raise an error.

M

Paul Wiles wrote in message <374bdf93_at_newsread3.dircon.co.uk>...
>I'm calling it from a DBI perl routine:
>
>my %sth = $dbh->prepare(q{
> BEGIN
> myproc(totalamt => :totalamt);
> END;
> });
>
>$sth->bind_param_inout(":totalamt",\$totalamt,10);
>
>The problem occurs within the proc when it sets the OUT variable to a
>character string with a length greater than 1. Of couse, I can't declare
>the OUT variable to be a varchar2(n), only a varchar2.
>
>So how does the OUT variable accept a value with more than 1 character.
I'm
>going round in circles and am very confused
>
>Help appreciated
>
>
>
>
>
>
>The problem is happening within the stored proc. The v_amt variable is
>
>Mark Gumbs wrote in message <374bcf5c.0_at_145.227.194.253>...
>>I assume you are calling the procedure from somewhere else
>>
>>e.g
>>
>>declare
>> v_amt varchar2(5);
>>begin
>> myproc(v_amt);
>>end;
>>
>>If your declaration of v_amt is not big enough (e.g varchar2(2) instead of
>>varchar2(5) ), this will cause a numeric or value error.
>>
>>Mark
>>
>>
>>Paul Wiles wrote in message <374bc9ff_at_newsread3.dircon.co.uk>...
>>>I have the procedure
>>>
>>>procedure myproc(amt OUT varchar2) AS
>>>
>>>BEGIN
>>> select to_char(233.3,'9,999') into amt from dual;
>>>END myproc;
>>>
>>>when I run the proc I get a 'numeric or value' error. It appears that I
>>>cannot insert the value returned by to_char into the variable amt.
>>>
>>>As far as I am aware amt is of the correct datatype - varchar2. What am
I
>>>doing wrong?
>>>
>>>Thanks
>>>
>>>
>>>
>>>
>>
>>
>
>
Received on Wed May 26 1999 - 07:30:31 CDT

Original text of this message

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