开发者

To have two Pg queries in one Python method

Thank you for Denis who solves the first bug!

How can you have two Postgres queries in one Python method?

Example where the 2nd query is not run

def comp_func(pgmasi):
        pgmasi.query("""CREATE TABLE courses (
        course_id       SERIAL PRIMARY KEY)""")
       开发者_开发知识库 pgmasi.query("""CREATE TABLE files (    # not executed for some unknown reason
        file_id         SERIAL PRIMARY KEY""")


Probably you missed closing parentheses in the line as error message says:

pgmasi.query("INSERT INTO files('binf','file_name') VALUES(file,file_name)"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜