<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - wyjatki]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=199&amp;type=atom"/>
	<updated>2009-04-30T12:56:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=199</id>
		<entry>
			<title type="html"><![CDATA[Odp: wyjatki]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=795#p795"/>
			<content type="html"><![CDATA[Nie mam teraz pod reka postgresa, ale moze tak

CREATE OR REPLACE FUNCTION fun3(real,real)
RETURNS real
AS '
DECLARE
zm integer;
BEGIN
zm:=$1/$2;
RETURN zm;
EXCEPTION
WHEN division_by_zero THEN
RAISE NOTICE ''BLAD DZIELENIA PRZEZ ZERO!!!'';
RETURN 0;
END;
'LANGUAGE 'plpgsql';]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2009-04-30T12:56:07Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=795#p795</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: wyjatki]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=792#p792"/>
			<content type="html"><![CDATA[no tak te wywolania daja to samo co select * from fun3(10,0)
ale mnie chodzi czy jak dziele przez zero to jak mam RAISE NOTICE ''BLAD DZIELENIA PRZEZ ZERO!!!''; to powinien wyswietlic sie ten komunikat czy poprostu 0]]></content>
			<author>
				<name><![CDATA[mpzs]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=886</uri>
			</author>
			<updated>2009-04-30T12:35:25Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=792#p792</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: wyjatki]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=789#p789"/>
			<content type="html"><![CDATA[A ,może powinieneś uruchomić funkcję poleceniem 
[code]
SELECT  fun3(20,5);
SELECT  fun3(10,0);
[/code]
bo nie zwraca ona recordsetów]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2009-04-30T12:11:15Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=789#p789</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[wyjatki]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=786#p786"/>
			<content type="html"><![CDATA[chce zrobic proceure ktora wyswietla wyjatek ma to dotyczyc dzielenia przez 0. napisalam taka procedure ale nie wiem czy ona dobrze dziala. prosze o pomoc.

CREATE OR REPLACE FUNCTION fun3(real,real)
RETURNS real
 AS '
BEGIN
RETURN $1/$2;
EXCEPTION
WHEN division_by_zero THEN
RAISE NOTICE ''BLAD DZIELENIA PRZEZ ZERO!!!'';
RETURN 0;
END;
'LANGUAGE 'plpgsql';

SELECT * from fun3(20,5);
SELECT * from fun3(10,0);

i nie wiem czy nie powinien wyswietlic sie komunikat blad dzielenia przez zero. bo mnie wyswietla tylko 0.]]></content>
			<author>
				<name><![CDATA[mpzs]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=886</uri>
			</author>
			<updated>2009-04-30T09:35:50Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=786#p786</id>
		</entry>
</feed>
