Re: [GENERAL] executing a sql script

2009-01-17 Thread Joshua D. Drake
On Fri, 2009-01-16 at 22:09 -0800, johnf wrote: > I'm using python and can execute standard "select,update,delete,functions". > What I'd like to do is execute a sql script (a text file). But I don't know > how? You need to open the text file and pass it as an argument: try: file = "%s/%

Re: [GENERAL] executing a sql script

2009-01-17 Thread johnf
On Saturday 17 January 2009 07:14:06 am Adrian Klaver wrote: > On Friday 16 January 2009 10:09:06 pm johnf wrote: > > I'm using python and can execute standard > > "select,update,delete,functions". What I'd like to do is execute a sql > > script (a text file). But I don't know how? > > Some thing

Re: [GENERAL] executing a sql script

2009-01-17 Thread Adrian Klaver
On Friday 16 January 2009 10:09:06 pm johnf wrote: > I'm using python and can execute standard "select,update,delete,functions". > What I'd like to do is execute a sql script (a text file). But I don't > know how? > Some thing like: > import psycopg2 > import psycopg2.extensions > conn =

[GENERAL] executing a sql script

2009-01-16 Thread johnf
I'm using python and can execute standard "select,update,delete,functions". What I'd like to do is execute a sql script (a text file). But I don't know how? Some thing like: import psycopg2 import psycopg2.extensions conn = psycopg2.connect("host=%s dbname=%s user =%s password =%s "