<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - Zapytanie dynamiczne]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=1241&amp;type=atom"/>
	<updated>2012-02-26T18:13:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=1241</id>
		<entry>
			<title type="html"><![CDATA[Odp: Zapytanie dynamiczne]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=3482#p3482"/>
			<content type="html"><![CDATA[Dokładnie tak jak w linku podanym powyżej
[code]
execute zmienna_string INTO zmienna;
[/code]]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2012-02-26T18:13:07Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=3482#p3482</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Zapytanie dynamiczne]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=3465#p3465"/>
			<content type="html"><![CDATA[to jeszcze mam pytanie :

chce zrobić rtrim dla stringa zapisanego w zmiennej.

Czyli 


zmiena_string := 'select rtrim ('aszws','ws')' i wynik tego chce zapisać do zmienej

chciałem zrobić tak:

zmienna := (execute zmiena_string  ); 
ale niestety  to tak nie działa ;( 

może ktoś ma pomysł jak to zrobić wszelkie sugestię będą cenne :)]]></content>
			<author>
				<name><![CDATA[Rafik83]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1332</uri>
			</author>
			<updated>2012-02-21T12:03:33Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=3465#p3465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Zapytanie dynamiczne]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=3464#p3464"/>
			<content type="html"><![CDATA[Super dzięki za pomoc jak będę w Krakowie to masz u mnie  żywca z pianką :) 

[quote=gszpetkowski]Tutaj także możesz użyć Execute, po szczegóły zajrzyj do [url]http://www.postgresql.org/docs/current/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN[/url][/quote]]]></content>
			<author>
				<name><![CDATA[Rafik83]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1332</uri>
			</author>
			<updated>2012-02-20T10:51:06Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=3464#p3464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Zapytanie dynamiczne]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=3463#p3463"/>
			<content type="html"><![CDATA[Tutaj także możesz użyć Execute, po szczegóły zajrzyj do [url]http://www.postgresql.org/docs/current/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN[/url]]]></content>
			<author>
				<name><![CDATA[gszpetkowski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1223</uri>
			</author>
			<updated>2012-02-20T10:45:09Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=3463#p3463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Zapytanie dynamiczne]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=3462#p3462"/>
			<content type="html"><![CDATA[Potrzebuję pomocy przy zapytaniu które wykonuję się dynamicznie, czyli jest budowane wew procedury ze względu na warunki
czyli coś takiego w uproszczeniu 

zmiena_string_1 varchar (10);
 zmiena_string_2 varchar (10);
 zmiena_string_3 varchar (10);
 zmiena_string_4 varchar (10);
 zmiena_string_5 varchar (10);
 zmiena_string_suma varchar (10);
 
 
 zmiena_string_1:= 'select'
 zmiena_string_2:= 'pole'
 zmiena_string_3:= 'from'
 zmiena_string_4:= 'tabela'
 zmiena_string_5 := ' '
 
 
 zmiena_string_suma := zmiena_string_1 + zmiena_string_5
  + zmiena_string_2 + zmiena_string_5 + zmiena_string_3 + zmiena_string_5
  + zmiena_string_3
  
 /* lub coś takiego: */ 
  
  zmiena_string_suma := ''zmiena_string_1' + + 'zmiena_string_5''....
  
  
  /*co daj nam zmiena_string_suma := select [pole] from [tabela]*/
  
 /* Teraz chce wywołać zmiena_string_suma aby zrobiło się zapytanie.
  
  W MS SQL możn było zrobić tak i póżniej wywołać exec (zmiena_string_suma) 
  i wewnątrz prcedury wykonywało się tak zbudowane zapytanie */]]></content>
			<author>
				<name><![CDATA[Rafik83]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1332</uri>
			</author>
			<updated>2012-02-20T10:30:35Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=3462#p3462</id>
		</entry>
</feed>
