<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - funkcja z loop]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=573&amp;type=atom"/>
	<updated>2011-04-13T19:53:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=573</id>
		<entry>
			<title type="html"><![CDATA[Odp: funkcja z loop]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2475#p2475"/>
			<content type="html"><![CDATA[Jak najrzadziej :)
Ale przyda Ci się gdy na przykład bedziesz pobierał/zmienial dane z/w tabeli i nazwa tabeli będzie parametryzowana.]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2011-04-13T19:53:26Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2475#p2475</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: funkcja z loop]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2474#p2474"/>
			<content type="html"><![CDATA[kiedy należy używać 'execute' ?]]></content>
			<author>
				<name><![CDATA[pawmar]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1130</uri>
			</author>
			<updated>2011-04-13T14:56:53Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2474#p2474</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: funkcja z loop]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2473#p2473"/>
			<content type="html"><![CDATA[trzeba chyba operać sie na własnym doświadczeniu i doświadczeniu innych (na przykład zadając pytania na forach :) )]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2011-04-12T18:19:46Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2473#p2473</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: funkcja z loop]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2472#p2472"/>
			<content type="html"><![CDATA[Dzięki, oba sposoby działają.

Znacie jakieś ciekawe tutoriale, z których można się nauczyć pisania funkcji w postgresie, bo w dokumentacji to za dużo wyjaśnień nie ma.]]></content>
			<author>
				<name><![CDATA[pawmar]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1130</uri>
			</author>
			<updated>2011-04-12T18:06:55Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2472#p2472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: funkcja z loop]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2471#p2471"/>
			<content type="html"><![CDATA[Można też zrobić to tak :
[code]
for i in 8..16 LOOP
   insert into petla values (now()  + CAST(i || 'minute' AS INTERVAL));
end loop;

[/code]]]></content>
			<author>
				<name><![CDATA[Rogo]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1161</uri>
			</author>
			<updated>2011-04-12T12:36:06Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2471#p2471</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: funkcja z loop]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2470#p2470"/>
			<content type="html"><![CDATA[W tym przypadku chyba bedziesz musial uzyc dymanicznego sql
[code]
execute 'insert into petla values (now() + interval '''||i||' minute'')';
[/code]]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2011-04-12T10:49:41Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2470#p2470</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[funkcja z loop]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=2469#p2469"/>
			<content type="html"><![CDATA[hej, jak przekazać 'i' z pętli od insert'a:

create or replace function zwieksz() return void as
$$
begin
for i in 8..16 LOOP
   insert into petla values (now() + interval 'i minute');
end loop;
end;
$$
language 'plpgsql';]]></content>
			<author>
				<name><![CDATA[pawmar]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1130</uri>
			</author>
			<updated>2011-04-11T20:59:03Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=2469#p2469</id>
		</entry>
</feed>
