lgerras84
lgerras84

Reputation: 53

How to pass an out parameter in oracle stored procedure for python

I have a question, I've tried to pass an out parameter but appears an error, this is my code:

cursor = connection.cursor()
lOutput = cursor.var(cx_Oracle.STRING)
lOutput.setvalue(0, '')
cursor.callproc("SOME_PROC',[lOutput])
return lOutput .getvalue(0)

Please help me. thanks in advance.

Upvotes: 1

Views: 1734

Answers (1)

GSandro_Strongs
GSandro_Strongs

Reputation: 841

I change the last line like this

return lOutput .getvalue()

And it runs.

Upvotes: 2

Related Questions