I have a stored procedure that has a single output parameter. Why do I
have to pass it a string big enough to hold the value it is to receive?
Why can't I pass an empty string or None?
[color=blue][color=green][color=darkred]
>>> import cx_Oracle as oracle
>>> connection = oracle.connect( 'usr/pwd@tns')
>>> cursor = connection.curs or()
>>> network_name, = cursor.callproc ('my_pkg.get_ne twork_name_sp', ('',))[/color][/color][/color]
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
DatabaseError: ORA-06502: PL/SQL: numeric or value error: character
string buffer too small
ORA-06512: at "USR.MY_PKG ", line 35
ORA-06512: at line 1
The following works fine, but I don't like having to do it:
[color=blue][color=green][color=darkred]
>>> network_name, = cursor.callproc ('my_pkg.get_ne twork_name_sp', (' ' * 32,))[/color][/color][/color]
Am I missing something obvious here?
have to pass it a string big enough to hold the value it is to receive?
Why can't I pass an empty string or None?
[color=blue][color=green][color=darkred]
>>> import cx_Oracle as oracle
>>> connection = oracle.connect( 'usr/pwd@tns')
>>> cursor = connection.curs or()
>>> network_name, = cursor.callproc ('my_pkg.get_ne twork_name_sp', ('',))[/color][/color][/color]
Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
DatabaseError: ORA-06502: PL/SQL: numeric or value error: character
string buffer too small
ORA-06512: at "USR.MY_PKG ", line 35
ORA-06512: at line 1
The following works fine, but I don't like having to do it:
[color=blue][color=green][color=darkred]
>>> network_name, = cursor.callproc ('my_pkg.get_ne twork_name_sp', (' ' * 32,))[/color][/color][/color]
Am I missing something obvious here?
Comment