How to sql scripts in a file?

Поиск
Список
Период
Сортировка
От John Zhang
Тема How to sql scripts in a file?
Дата
Msg-id CAKDSG9AULGW-rdC9_KArVm2D=GPmcUce+n0kAFSDKfWtqVGnmA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [postgis-users] How to sql scripts in a file?
Список pgsql-sql
Hello all,

I have a need to execute sql scripts in a file with comments in Python 2.7. 
here is m code snippet:

sqlF = r'{}\{}'.format(sFldr_sql,sSQLFile)
sql_file_contents = open(sqlF,'r').read()
cur.execute(sql_file_contents)
 
the file can be executed from pgAdmin successfully. However, the code above runs quietly without any issues raised but NO results was worked out.

In the sql file, there are scripts to DROP FUNCTION  IF EXISTS and CREATE OR REPLACE FUNCTION.

Your input to shed light on it would be much appreciated.

Thank you

--
Yours sincerely,


John Zhang


В списке pgsql-sql по дате отправления:

Предыдущее
От: Ashutosh Sharma
Дата:
Сообщение: Re: FK constraint question
Следующее
От: Sándor Daku
Дата:
Сообщение: Fwd: How to sql scripts in a file?