From: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: script |
Date: | 2005-11-10 08:31:26 |
Message-ID: | 20051110083126.GC28217@webserv.wug-glas.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
am 10.11.2005, um 10:10:22 +0100 mailte Maik Trömel folgendes:
> Hello!
>
> I want to run a shell script with variables under Postgresql.
>
> An example:
> I want to make the following query;
>
> select * from tablename where id=1;
> select * from tablename where id=2;
> select * from tablename where id=3;
> select * from tablename where id=4;
> .........
>
> Is it possible to do it this way and what is the right syntax. All i've
> tried out didn't work.
>
> while i<100 do
> select * from tablename where id=i;
> i=i+1;
> done
for i in `seq 10` ; do
echo "select * from foo where id = $i" | psql test
done;
HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
From | Date | Subject | |
---|---|---|---|
Next Message | surabhi.ahuja | 2005-11-10 08:35:28 | Re: Postmaster failing to start on reboot |
Previous Message | surabhi.ahuja | 2005-11-10 08:28:55 | Re: Postmaster failing to start on reboot |