#NEWLINE# def callproc( self , procname , args = ( ) ) : #NEWLINE# #INDENT# 'Calls a stored database procedure with the given name.\n\n    Args:\n      procname: A string, the name of the stored procedure.\n      args: A sequence of parameters to use with the procedure.\n\n    Returns:\n      A modified copy of the given input args. Input parameters are left\n      untouched, output and input/output parameters replaced with possibly new\n      values.\n\n    Raises:\n      InternalError: The cursor has been closed, or no statement has been\n        executed yet.\n      DatabaseError: A SQL exception occurred.\n      OperationalError: RPC problem.\n    ' #NEWLINE# self . _CheckOpen ( ) #NEWLINE# self . _Reset ( ) #NEWLINE# request = sql_pb2 . ExecRequest ( ) #NEWLINE# request . statement_type = sql_pb2 . ExecRequest . CALLABLE_STATEMENT #NEWLINE# request . statement = ( 'CALL %s(%s)' % ( procname , ',' . join ( ( '?' * len ( args ) ) ) ) ) #NEWLINE# self . _AddBindVariablesToRequest ( result . statement , args , request . bind_variable . add , direction = client_pb2 . BindVariableProto . INOUT ) #NEWLINE# result = self . _DoExec ( request ) #NEWLINE# self . _executed = request . statement #NEWLINE# return_args = list ( args [ : ] ) #NEWLINE# for var in result . output_variable : #NEWLINE# #INDENT# return_args [ ( var . position - 1 ) ] = self . _DecodeVariable ( var . type , var . value ) #NEWLINE# #UNINDENT# return tuple ( return_args )