Issue Details (XML | Word | Printable)

Key: PYFB-79
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Pavel Cisar
Reporter: Adriano de Souza
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird driver for Python

I believe I found a procedure bug with a single parameter

Created: 20/Jun/19 03:58 AM   Updated: 20/Jun/19 08:26 AM
Component/s: None
Affects Version/s: 2.0
Fix Version/s: None

Environment: Ubuntu 18.04 Python 3.7 Firebird 3.0

 Description  « Hide
work with a firebird 3.0 database and use many procedures with only one input parameter.

When I try to execute a procedure with two paramenters

cursor.callproc ("myproc", (param1, param2))
outputParams = cursor.fetchall ()
firebird.commit ()
print (outputParams)

Everything works fine.

But when trying to execute a procedure with only one parameter

cursor.callproc ("mysingleproc", (param1))
outputParams = cursor.fetchall ()
firebird.commit ()
print (outputParams)

I get a return error.
callproc paremeters must be List or Tuple

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 20/Jun/19 08:26 AM
The parameter list must be a list or tuple. If you want to pass only single parameter as a tuple, you have to add a colon, i.e. (param,) otherwise the Python will handle it as expression and not as tuple constructor. Or use a list, as [para,1] will make a list with single item.