dbTalk Databases Forums  

[BUGS] BUG #2785: Exception Issue

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2785: Exception Issue in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Patrick Hayes
 
Posts: n/a

Default [BUGS] BUG #2785: Exception Issue - 11-27-2006 , 08:24 PM







The following bug has been logged online:

Bug reference: 2785
Logged by: Patrick Hayes
Email address: pkhayeskp (AT) hotmail (DOT) com
PostgreSQL version: 8.1
Operating system: Windows Professional
Description: Exception Issue
Details:

I am defining Exception blocks. When I put something that others in the
when clause, it will not compile. The others clause works fine.

The following is working fine.
BEGIN

PPSDATA.member_date_of_birth=date(substr(ROWDATA.i nline,55,4)||'-'||
substr(ROWDATA.inline,59,2)||'-'||substr(ROWDATA.inline,61,2));
EXCEPTION WHEN OTHERS THEN
ERRORCODE:='Y';
PPSERROR.current_month_error:='*';
END;

The following is not working fine.
BEGIN
select count(*) into cnt_county from county_code
where county_code = PPSERROR.member_county_code;
EXCEPTION
WHEN no_data then
PPSERROR.member_county_code_error:='*';
RAISE NOTICE ' ---county_code_error out %', PPSERROR.member_county_code;
ERRORCODE:='Y';
END;


I get the following error.

postgres-# language plpgsql;
ERROR: unrecognized exception condition "no_data"
CONTEXT: compile of PL/pgSQL function "chip_pps_data_check" near line 101

Thanks

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2785: Exception Issue - 11-27-2006 , 09:06 PM






"Patrick Hayes" <pkhayeskp (AT) hotmail (DOT) com> writes:
Quote:
I get the following error.

postgres-# language plpgsql;
ERROR: unrecognized exception condition "no_data"
CONTEXT: compile of PL/pgSQL function "chip_pps_data_check" near line 101
Indeed, because no_data is not an error condition, so EXCEPTION can't
catch it. Possibly you could do something with testing the FOUND
variable instead.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
  #3  
Old   
pat hayes
 
Posts: n/a

Default Re: [BUGS] BUG #2785: Exception Issue - 11-28-2006 , 10:55 AM



Tom,
Thank you for your input. I found a way to check for it by counting the
return from a count. Thanks again for your help.

PAT


Quote:
From: Tom Lane <tgl (AT) sss (DOT) pgh.pa.us
To: "Patrick Hayes" <pkhayeskp (AT) hotmail (DOT) com
CC: pgsql-bugs (AT) postgresql (DOT) org
Subject: Re: [BUGS] BUG #2785: Exception Issue Date: Mon, 27 Nov 2006
22:05:04 -0500

"Patrick Hayes" <pkhayeskp (AT) hotmail (DOT) com> writes:
I get the following error.

postgres-# language plpgsql;
ERROR: unrecognized exception condition "no_data"
CONTEXT: compile of PL/pgSQL function "chip_pps_data_check" near line
101

Indeed, because no_data is not an error condition, so EXCEPTION can't
catch it. Possibly you could do something with testing the FOUND
variable instead.

regards, tom lane
__________________________________________________ _______________
MSN Shopping has everything on your holiday list. Get expert picks by style,
age, and price. Try it!
http://shopping.msn.com/content/shp/...e=wlmtag line


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.