batch file
batch file
От:
Milen <milend@ansco.com>
Дата:
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
Re: batch file
От:
Jason Earl <jdearl@yahoo.com>
Дата:
I just put files commands that I want in some file like "foo.sql" and then do: psql mydatabase -f foo.sql Is this what you are looking for? Jason --- 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 __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: batch file
От:
Jie Liang <jliang@ipinc.com>
Дата:
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@ipinc.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 >
Re: batch file
От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Milen writes: > 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. psql [options] -f yourfile.sql -- Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
Re: batch file
От:
"Richard Huxton" <dev@archonet.com>
Дата:
From: "Milen" > 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. You can do exactly that. Use "man psql" to find out about the -f option or the \i option. - Richard Huxton
Re: batch file
От:
"bugi" <bakarat@poczta.wp.pl>
Дата:
Create the file for example command.sql and log into the database psql mydbase and write command \i command.sql U�ytkownik "Milen" napisa� w wiadomo�ci news:01C0E51F.F2E673F0.milend@ansco.com... > 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
Re: batch file
От:
Grant <grant@conprojan.com.au>
Дата:
> 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. That or just separate commands by a semi colon: select * from table1; select * from table2;