Thread: script
View Single Post

   
  #1 (permalink)  
Old 04-09-2008, 06:56 AM
=?ISO-8859-1?Q?Maik_Tr=F6mel?=
 
Posts: n/a
Default script

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

Thanks for your help.

Greetings
Maik

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply With Quote