internal/protocol/session.go
func (s *Session) Call(id uint64, prmFieldSet *ParameterFieldSet, args []driver.NamedValue) (*FieldValues, []*TableResult, error) {
	s.mu.Lock()
	defer s.mu.Unlock()

	s.statementID.id = &id
	if err := s.writeRequest(mtExecute, false, s.statementID, newInputParameters(prmFieldSet.inputFields(), args)); err != nil {
		return nil, nil, err
	}

	prmFieldValues := newFieldValues()
	var tableResults []*TableResult
	var tableResult *TableResult

	f := func(p replyPart) {

		switch p := p.(type) {

		case *outputParameters:
			p.s = s
			p.outputFields = prmFieldSet.outputFields()
			p.fieldValues = prmFieldValues

		// table output parameters: meta, id, result (only first param?)
		case *resultMetadata:
			tableResult = newTableResult(s, p.numArg)
			tableResults = append(tableResults, tableResult)
			p.resultFieldSet = tableResult.resultFieldSet
		case *resultsetID:
			p.id = &(tableResult.id)
		case *resultset:
			p.s = s
			tableResult.attrs = s.ph.partAttributes
			p.resultFieldSet = tableResult.resultFieldSet
			p.fieldValues = tableResult.fieldValues
		}
	}

	if err := s.readReply(f); err != nil {
		return nil, nil, err
	}

	if err := s.writeLobStream(prmFieldSet, prmFieldValues, args); err != nil {
		return nil, nil, err
	}

	return prmFieldValues, tableResults, nil
}
func (s *Session) Call(id uint64, prmFieldSet *ParameterFieldSet, args []driver.NamedValue) (*FieldValues, []*TableResult, error) {
	s.mu.Lock()
	defer s.mu.Unlock()

	s.statementID.id = &id
	if err := s.writeRequest(mtExecute, false, s.statementID, newInputParameters(prmFieldSet.inputFields(), args)); err != nil {
		return nil, nil, err
	}

	prmFieldValues := newFieldValues()
	var tableResults []*TableResult
	var tableResult *TableResult

	f := func(p replyPart) {

		switch p := p.(type) {

		case *outputParameters:
			p.s = s
			p.outputFields = prmFieldSet.outputFields()
			p.fieldValues = prmFieldValues

		// table output parameters: meta, id, result (only first param?)
		case *resultMetadata:
			tableResult = newTableResult(s, p.numArg)
			tableResults = append(tableResults, tableResult)
			p.resultFieldSet = tableResult.resultFieldSet
		case *resultsetID:
			p.id = &(tableResult.id)
		case *resultset:
			p.s = s
			tableResult.attrs = s.ph.partAttributes
			p.resultFieldSet = tableResult.resultFieldSet
			p.fieldValues = tableResult.fieldValues
		}
	}

	if err := s.readReply(f); err != nil {
		return nil, nil, err
	}

	if err := s.writeLobStream(prmFieldSet, prmFieldValues, args); err != nil {
		return nil, nil, err
	}

	return prmFieldValues, tableResults, nil
}
// Call executes a stored procedure.