4

I have developed stored procedure in postgresql which accepting 2 parameters & I am calling it using sqlalchemy using below code but getting syntax error.

I have tried sqlalchemy online tutorials.

connection.execute('stored_proce_name ?, ?',  para_1, para_2 )                                        

Getting error like :ProgrammingError('(psycopg2.errors.SyntaxError) syntax error at or near "stored_proce_name "\nLINE 1: stored_proce_name ?, ?\n ^\n')

1 Answer 1

3

Here's how I do it:

result = conn.execute(StoredProc("add", (3, 4), Integer))
Sign up to request clarification or add additional context in comments.

5 Comments

what is meaning for Integer here ?
it is referred to the return type
Hi @Moon, if my answer was useful for you please consider upvoting it and/or choosing it as final answer. Thanks!
Hi, where does the StoredProcedure class come from?
What in Earth is StoredProc!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.