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: Funciton & VARCHAR2 problem

Re: Funciton & VARCHAR2 problem

From: miker <mdent12_at_none.com>
Date: Wed, 10 Apr 2002 17:48:04 GMT
Message-ID: <elu8buodrfnk4ej4k8hm0kkru2har9te82@4ax.com>


On Wed, 10 Apr 2002 16:47:38 GMT, j.w.vandijk.removethis_at_hetnet.nl (Jaap W. van Dijk) wrote:

>What's the error?

ver 8.1.7, Win2k. The returned count is 0.

The column "code" in table dd is defined as char(4).

How do I define variable p_code? The "FUNCTION dCount (p_code IN VARCHAR2)" declaration gives no results at all, i.e. count is 0. If I try to declare it as "CHAR(4)" I get compilation error.

>Jaap.
>
>On Wed, 10 Apr 2002 16:14:29 GMT, miker <mdent12_at_none.com> wrote:
>
>>if i hard code the variable i get the right result but if the
>>parameter is passed in as a VARCHAR2 it doesn't work. what is wrong?
>>
>> FUNCTION dCount (p_code IN VARCHAR2)
>> RETURN NUMBER IS
>> result NUMBER;
>> BEGIN
>> select count(*) INTO result from dd a
>> where a.code=p_code -- works fine if i say a.code='HR';
>> RETURN result;
>> END;
Received on Wed Apr 10 2002 - 12:48:04 CDT

Original text of this message

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