#NEWLINE# def submit_rpc( self , rpc_name , params , flags ) : #NEWLINE# #INDENT# ' Sends an RPC request.\n\n        This call will transition session into pending state.\n        If some operation is currently pending on the session, it will be\n        cancelled before sending this request.\n\n        Spec: http://msdn.microsoft.com/en-us/library/dd357576.aspx\n\n        :param rpc_name: Name of the RPC to call, can be an instance of :class:`InternalProc`\n        :param params: Stored proc parameters, should be a list of :class:`Column` instances.\n        :param flags: See spec for possible flags.\n        ' #NEWLINE# self . messages = [ ] #NEWLINE# self . output_params = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . cancel_if_pending ( ) #NEWLINE# self . res_info = None #NEWLINE# w = self . _writer #NEWLINE# with self . querying_context ( TDS_RPC ) : #NEWLINE# #INDENT# self . _START_QUERY ( ) #NEWLINE# if ( IS_TDS71_PLUS ( self ) and isinstance ( rpc_name , InternalProc ) ) : #NEWLINE# #INDENT# w . put_smallint ( ( - 1 ) ) #NEWLINE# w . put_smallint ( rpc_name . proc_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( rpc_name , InternalProc ) : #NEWLINE# #INDENT# rpc_name = rpc_name . name #NEWLINE# #UNINDENT# w . put_smallint ( len ( rpc_name ) ) #NEWLINE# w . write_ucs2 ( rpc_name ) #NEWLINE# #UNINDENT# w . put_usmallint ( flags ) #NEWLINE# self . _out_params_indexes = [ ] #NEWLINE# for ( i , param ) in enumerate ( params ) : #NEWLINE# #INDENT# if ( param . flags & fByRefValue ) : #NEWLINE# #INDENT# self . _out_params_indexes . append ( i ) #NEWLINE# #UNINDENT# w . put_byte ( len ( param . column_name ) ) #NEWLINE# w . write_ucs2 ( param . column_name ) #NEWLINE# w . put_byte ( param . flags ) #NEWLINE# w . put_byte ( rpc_name . type . type ) #NEWLINE# param . type . write_info ( w ) #NEWLINE# param . type . write ( w , param . value )