🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.bazy-danych
Article #195199

Re: Szybkie wypełnianie zerami tabeli

#195199
From: Borneq
Date: Fri, 20 Jan 2017 11:03
27 lines
1850 bytes
W dniu 20.01.2017 o 11:47, Cezary Grądys pisze:
> SELECT * FROM x;
> test=> WITH RECURSIVE x AS
> (
>   SELECT 1 AS a, 0 AS b, 0 AS c
>   UNION ALL
>   SELECT 1+a, b, c FROM x WHERE a<100000
> )
> SELECT * FROM x;
>
> Na postgresie działa

Tu mamy dwa selecty do sprawdzenia i polecenie? Jak się robi polecenie z 
"test=>"
u mnie wygląda to tak:
	MySqlDB db("127.0.0.1", "root", "rootpass", "bitcoin");
	string stmt;
	stmt += "test = > WITH RECURSIVE x AS\n";
	stmt += "(\n";
	stmt += "SELECT 1 AS a, 0 AS b, 0 AS c\n";
	stmt += "UNION ALL\n";
	stmt += "SELECT 1 + a, b, c FROM x WHERE a<100000\n";
	stmt += ")\n";
	db.execute(stmt);

i coś tu nie gra.
To jest procedura , jak się obsługuje odwrotnie od zwykłych statement?
Technical Details
Message-ID: <o5sqph$d1h$1@node1.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <o5sn7j$9es$1@node1.news.atman.pl> <bfee7e61-5c91-4ecb-9bf4-58669fd86424@googlegroups.com> <o5sniu$9n7$1@node1.news.atman.pl> <e6fc45bd-6dc5-4c69-9e4b-42f7723e5351@googlegroups.com> <5881eac8$0$15207$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Borneq <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.bazy-danych
Subject: Re: Szybkie wypełnianie zerami tabeli
Date: Fri, 20 Jan 2017 12:03:12 +0100
Organization: ATMAN - ATM S.A.
Lines: 29
Message-ID: <o5sqph$d1h$1@node1.news.atman.pl>
References: <o5sn7j$9es$1@node1.news.atman.pl> <bfee7e61-5c91-4ecb-9bf4-58669fd86424@googlegroups.com> <o5sniu$9n7$1@node1.news.atman.pl> <e6fc45bd-6dc5-4c69-9e4b-42f7723e5351@googlegroups.com> <5881eac8$0$15207$65785112@news.neostrada.pl>
NNTP-Posting-Host: 91.239.205.105
Mime-Version: 1.0
X-Trace: node1.news.atman.pl 1484910193 13361 91.239.205.105 (20 Jan 2017 11:03:13 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Fri, 20 Jan 2017 11:03:13 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
In-Reply-To: <5881eac8$0$15207$65785112@news.neostrada.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit