Call Postgres SQL stored procedure From Django

前端 未结 3 1202
花落未央
花落未央 2020-12-30 15:22

I am working on a Django Project with a Postgres SQL Database. I have written a stored procedure that runs perfectly on Postgres.

Now I want to call that stored proc

3条回答
  •  抹茶落季
    2020-12-30 15:52

    There is a missing closing parenthesis at the c.execute("SELECT fn_save_message3(... line. Add ) after last quote symbol.

    But anyway it is a wrong method of executing SQL from python code. You should use placeholders to prevent sql injection attacks. Read the documentation with examples of the proper use of SQL in django.

提交回复
热议问题