Re: batch file

From: Jie Liang <jliang(at)ipinc(dot)com>
To: Milen <milend(at)ansco(dot)com>
Cc: "'pgsql-sql(at)postgresql(dot)org(dot)'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: batch file
Date: 2001-05-25 18:04:14
Message-ID: Pine.BSF.4.10.10105251059040.61843-100000@tidal.ipinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I am not sure what's your question.
However, you can list a bunch of SQL statements in a text file:
e.g.
myfile.sql which contains:

select * from tablename where ....
update tablename set ... where ...
.....

then, you can just run it like:

psql -q dbname < myfile.sql

Jie LIANG

St. Bernard Software

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang(at)ipinc(dot)com
www.stbernard.com
www.ipinc.com

On Fri, 25 May 2001, Milen wrote:

> Hi all!,
>
> I want to execute several SQL statements one after another.
> Does anyone know if it is possible to create something like a "batch file"
> which contains all SQL commands I want.
>
> Best Regards:
> Milen
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2001-05-25 18:11:27 Re: batch file
Previous Message Jason Earl 2001-05-25 17:53:34 Re: batch file