Xref: alice comp.databases.oracle.tools:13973 Path: alice!news-feed.fnsi.net!newsfeed.wli.net!wn4feed!worldnet.att.net!135.173.83.225!attworldnet!newsadm From: Ken Kline Newsgroups: comp.databases.oracle.tools Subject: Re: Help with D2K Date: Mon, 29 Jun 1998 21:14:21 -0700 Organization: AT&T WorldNet Services Lines: 49 Message-ID: <6n9ea0$89v@bgtnsc02.worldnet.att.net> References: <6n9df4$mtu$1@nnrp1.dejanews.com> Reply-To: mustang@fred.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) there is no value for v_prov# in second example yonglove@usa.net wrote: > I'm new to Oracle but can someone please tell me why code section #1 works > (does not hit the exception clause), but #2 fails (hits the exception > clause)??? > > --- code section #1 --- > > FUNCTION get_prov_name (v_prov# CHAR) > RETURN CHAR IS > v_provname VARCHAR2(29) ; > BEGIN > select RTRIM(firstname) || ' ' || RTRIM(lastname) > into v_provname > from health.provider@gtw > where prov# = 'HSP40113F' ; > RETURN v_provname ; > > EXCEPTION > WHEN OTHERS THEN > RETURN '-1'; > > END; > > --- code section #2 --- > > FUNCTION get_prov_name (v_prov# CHAR) > RETURN CHAR IS > v_provname VARCHAR2(29) ; > BEGIN > select RTRIM(firstname) || ' ' || RTRIM(lastname) > into v_provname > from health.provider@gtw > where prov# = v_prov# ; > RETURN v_provname ; > > EXCEPTION > WHEN OTHERS THEN > RETURN '-1'; > > END; > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- > http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum