<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - problem z parametrem OUT]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=291&amp;type=atom"/>
	<updated>2009-09-10T10:20:18Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=291</id>
		<entry>
			<title type="html"><![CDATA[Odp: problem z parametrem OUT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1296#p1296"/>
			<content type="html"><![CDATA[No nieźle 8.0, trochę to stare. No i niestety w 8.0 nie bylo parametrów out 
[url]http://www.postgresql.org/docs/8.0/interactive/sql-createfunction.html[/url]]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2009-09-10T10:20:18Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1296#p1296</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: problem z parametrem OUT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1295#p1295"/>
			<content type="html"><![CDATA[napiszę całą funkcję:
CREATE OR REPLACE FUNCTION searchObjectCLOB(pattern varchar, OUT result varchar)  AS $BODY$declare
  object record;
	
  begin

    for object in (select Id, Tag from p_objects order by id) loop
      if dbms_lob.instr(object.Tag, pattern) > 0 then
       result := result || object.Id || '|';
      end if;
    end loop;
  end;  $BODY$ LANGUAGE 'plpgsql' VOLATILE;


cały czas ten sam błąd:
ERROR:  CREATE FUNCTION / OUT parameters are not implemented


wersja:
PostgreSQL 8.0.0beta2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.2.3 (mingw special 20030504-1)]]></content>
			<author>
				<name><![CDATA[andyw]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=964</uri>
			</author>
			<updated>2009-09-10T10:17:36Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1295#p1295</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: problem z parametrem OUT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1294#p1294"/>
			<content type="html"><![CDATA[[code]
select version(); 
[/code]
albo
[code]
select version; 
[/code]

Ale zakładam że jakąś nowszą, wiec usuń po prostu returns.]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2009-09-10T10:14:47Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1294#p1294</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: problem z parametrem OUT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1293#p1293"/>
			<content type="html"><![CDATA[Wersja:
"PostgreSQL 8.0.0beta2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.2.3 (mingw special 20030504-1)"]]></content>
			<author>
				<name><![CDATA[andyw]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=964</uri>
			</author>
			<updated>2009-09-10T10:12:54Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1293#p1293</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: problem z parametrem OUT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1292#p1292"/>
			<content type="html"><![CDATA[Jaką masz wersję postgresa?
I po co ten 'returns void' skoro funkcja zwraca wartość typu varchar?]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2009-09-10T10:08:30Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1292#p1292</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[problem z parametrem OUT]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1291#p1291"/>
			<content type="html"><![CDATA[Witam!
Mam taki problem. Tworzę funkcję:
CREATE OR REPLACE FUNCTION "nazwa_funkcji"(in pattern varchar, out result varchar) RETURNS void AS ...itd...
i wyrzuca mi błąd:
ERROR:  CREATE FUNCTION / OUT parameters are not implemented
Totalnie nie rozumiem o co chodzi. Wydaje mi się, że deklaracja jest zgodna z dokumentacją.

Korzystając z możliwości chciałbym się jeszcze zapytać jak nadać wartość domyślną w funkcji. Gdy próbuję wywołać taką funkcję:
CREATE OR REPLACE FUNCTION add_state(process_id_ numeric, state_name_ varchar default 'new state' , state_nr_ numeric default null) returns numeric AS
dostaje błąd:
ERROR:  syntax error at or near "default" at character 191
Przyznam się, że trochę głupieje bo w ogóle nie rozumiem dlaczego tak się dzieje. Byłbym wdzięczny za wszelką pomoc. Z góry dziękuje.
Pozdrawiam]]></content>
			<author>
				<name><![CDATA[andyw]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=964</uri>
			</author>
			<updated>2009-09-10T09:57:59Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1291#p1291</id>
		</entry>
</feed>
