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: need help with simple Function

Re: need help with simple Function

From: Frank Piron <empty_at_zero.nil>
Date: Wed, 12 Jan 2005 08:40:26 +0100
Message-ID: <opskhbloj9m0et4w@news.online.de>


Hi,

Am Wed, 12 Jan 2005 07:17:41 GMT schrieb Randy Harris <randy_at_SpamFree.com>:

> I'm new to PL/SQL, need help with what should be (I think) a simple
> problem.
> I'm trying to sum the digits in a number, here's what I have so far:
>
> CREATE OR REPLACE FUNCTION Session_Hash
> (sessid IN NUMBER ) RETURN NUMBER
> IS
> dig_sum INTEGER;

You have to initialize with 0: dig_sum INTEGER:=0; Otherwise dig_sum is NULL and every expression with dig_sum as a component will evaluate to NULL.

-- 
Frank Piron,
defrankatkonaddot
(leftrotate two)
Received on Wed Jan 12 2005 - 01:40:26 CST

Original text of this message

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