Hi,

 > I've got a whole script full of SQL for Firebird that I want to execute
 > from python with fdb. Is there a way?
 >
certainly,

 > The sqlite3 module has an 'executescript' extension for this.
 >
we don't, but feel free to help to write it ;)

 > Any suggestions?
 >
just format your script in a way it can be splitted, using for example '§'

and do something like :
f = open('tabledefinition.sql')
full_sql = f.read()
sql_commands = full_sql.split('§')

for sql_command in sql_commands:
     if sql_command == 'COMMIT':
        myconnection.commit()
     else:
        myconnection.execute_immediate(sql_command)

you got the idea


  • [firebird-pytho... Hamish Moffatt ham...@risingsoftware.com [firebird-python]
    • Re: [fireb... Philippe Makowski pmakow...@ibphoenix.fr [firebird-python]

Reply via email to