0

I have a stored procedure defined escalate which taking a string parameter clientid.

I'm using sqlalchemy in python and using ORM. I have db.session created.

I'm not sure how i could call stored procedure with this session.

Anyone could point me the solution?

I have tried following; but getting an error:

TypeError: get_bind() got an unexpected keyword argument 'param'

Code:

from sqlalchemy import and_, func,text

db.session.execute(text("CALL escalate(:param)"), param=clientid)

1 Answer 1

1

From the docs session.execute needs a dict over kwargs, unlike the connection object which should have worked as you wrote it.

db.session.execute(
    "CALL escalate(:param)",
    {'param': clientid}
)
Sign up to request clarification or add additional context in comments.

1 Comment

do you know why i face this error?stackoverflow.com/questions/58987744/… They way i call storedprocedure is right or wrong?

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.