<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - Funkcja z OUT i RETURN]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=354&amp;type=atom"/>
	<updated>2009-11-30T13:09:38Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=354</id>
		<entry>
			<title type="html"><![CDATA[Odp: Funkcja z OUT i RETURN]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1598#p1598"/>
			<content type="html"><![CDATA[oto zapis z dokumentacji

[code]
When there are OUT or INOUT parameters, the RETURNS clause can be omitted. If present, it must agree with the result type implied by the output parameters: RECORD if there are multiple output parameters, or the same type as the single output parameter. 
[/code]
Typy z OUT i RETURN muszą się zgadzać]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2009-11-30T13:09:38Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1598#p1598</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Funkcja z OUT i RETURN]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1597#p1597"/>
			<content type="html"><![CDATA[Czy taka konstrukcja funkcji w pgsql jest poprawna

FUNCTION get(p_param_id IN  smallint,
                            p_table_id   IN  bigint,
                            o_exists      OUT boolean) RETURN table_name%rowtype;

Czy można jednocześnie stosować parametr OUT z RETURN?

Wywołując funkcję
Declare
v_rekord  table_name%rowtype;
v_exist   boolean;
begin
v_rekord := get(1,’aaa’,v_exist);
end;

W debug widzę ze parametr o_exists   ustawia się poprawnie true lub false. Również v_rekord jest uzupełniany poprawnie.

[b]Ale v_exist zawsze jest null [/b]

pracuje na wersji 8,3]]></content>
			<author>
				<name><![CDATA[mborkk]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=997</uri>
			</author>
			<updated>2009-11-30T12:49:05Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1597#p1597</id>
		</entry>
</feed>
