prepare(request) {
    const parameters = [];
    parameters.push({
      type: _dataType.TYPES.Int,
      name: 'handle',
      value: undefined,
      output: true,
      length: undefined,
      precision: undefined,
      scale: undefined
    });
    parameters.push({
      type: _dataType.TYPES.NVarChar,
      name: 'params',
      value: request.parameters.length ? request.makeParamsParameter(request.parameters) : null,
      output: false,
      length: undefined,
      precision: undefined,
      scale: undefined
    });
    parameters.push({
      type: _dataType.TYPES.NVarChar,
      name: 'stmt',
      value: request.sqlTextOrProcedure,
      output: false,
      length: undefined,
      precision: undefined,
      scale: undefined
    });
    request.preparing = true; // TODO: We need to clean up this event handler, otherwise this leaks memory

    request.on('returnValue', (name, value) => {
      if (name === 'handle') {
        request.handle = value;
      } else {
        request.error = (0, _errors.RequestError)(`Tedious > Unexpected output parameter ${name} from sp_prepare`);
      }
    });
    this.makeRequest(request, _packet.TYPE.RPC_REQUEST, new _rpcrequestPayload.default('sp_prepare', parameters, this.currentTransactionDescriptor(), this.config.options));
  }
/**
   * Prepare the SQL represented by the request.
   *
   * The request can then be used in subsequent calls to
   * [[execute]] and [[unprepare]]
   *
   * @param request A [[Request]] object representing the request.
   *   Parameters only require a name and type. Parameter values are ignored.
   */
Prepare the SQL represented by the request.
The request can then be used in subsequent calls to
[[execute]] and [[unprepare]]

@param request A [[Request]] object representing the request.
Parameters only require a name and type. Parameter values are ignored.
Prepare the SQL represented by the request . The request can then be used in subsequent calls to [[ execute ]] and [[ unprepare ]] @param request A [[ Request ]] object representing the request . Parameters only require a name and type . Parameter values are ignored .
prepare(request) {
    const parameters = [];
    parameters.push({
      type: _dataType.TYPES.Int,
      name: 'handle',
      value: undefined,
      output: true,
      length: undefined,
      precision: undefined,
      scale: undefined
    });
    parameters.push({
      type: _dataType.TYPES.NVarChar,
      name: 'params',
      value: request.parameters.length ? request.makeParamsParameter(request.parameters) : null,
      output: false,
      length: undefined,
      precision: undefined,
      scale: undefined
    });
    parameters.push({
      type: _dataType.TYPES.NVarChar,
      name: 'stmt',
      value: request.sqlTextOrProcedure,
      output: false,
      length: undefined,
      precision: undefined,
      scale: undefined
    });
    request.preparing = true; 
    request.on('returnValue', (name, value) => {
      if (name === 'handle') {
        request.handle = value;
      } else {
        request.error = (0, _errors.RequestError)(`Tedious > Unexpected output parameter ${name} from sp_prepare`);
      }
    });
    this.makeRequest(request, _packet.TYPE.RPC_REQUEST, new _rpcrequestPayload.default('sp_prepare', parameters, this.currentTransactionDescriptor(), this.config.options));
  }
prepare ( request ) { const parameters = [ ] ; parameters . push ( { type : _dataType . TYPES . Int , name : 'handle' , value : undefined , output : true , length : undefined , precision : undefined , scale : undefined } ) ; parameters . push ( { type : _dataType . TYPES . NVarChar , name : 'params' , value : request . parameters . length ? request . makeParamsParameter ( request . parameters ) : null , output : false , length : undefined , precision : undefined , scale : undefined } ) ; parameters . push ( { type : _dataType . TYPES . NVarChar , name : 'stmt' , value : request . sqlTextOrProcedure , output : false , length : undefined , precision : undefined , scale : undefined } ) ; request . preparing = true ; request . on ( 'returnValue' , ( name , value ) => { if ( name === 'handle' ) { request . handle = value ; } else { request . error = ( 0 , _errors . RequestError ) ( ` ${ name } ` ) ; } } ) ; this . makeRequest ( request , _packet . TYPE . RPC_REQUEST , new _rpcrequestPayload . default ( 'sp_prepare' , parameters , this . currentTransactionDescriptor ( ) , this . config . options ) ) ; }
Prepare the SQL represented by the request.
Prepare the SQL represented by the request .
// TODO: We need to clean up this event handler, otherwise this leaks memory