lib/connection/statement.js
function sendRequestPreExec(statementContext, onResultAvailable)
{
  // get the request headers
  var headers = statementContext.resultRequestHeaders;

  // build the basic json for the request
  var json =
  {
    disableOfflineChunks : false,
    sqlText              : statementContext.sqlText
  };

  // if binds are specified, build a binds map and include it in the request
  if (Util.exists(statementContext.binds))
  {
    json.bindings = buildBindsMap(statementContext.binds);
  }

  // include statement parameters if a value was specified
  if (Util.exists(statementContext.parameters))
  {
    json.parameters = statementContext.parameters;
  }

  // include the internal flag if a value was specified
  if (Util.exists(statementContext.internal))
  {
    json.isInternal = statementContext.internal;
  }

  // use the snowflake service to issue the request
  sendSfRequest(statementContext,
  {
    method  : 'POST',
    headers : headers,
    url     : Url.format(
    {
      pathname : '/queries/v1/query-request',
      search   : QueryString.stringify(
      {
        requestId: statementContext.requestId
      })
    }),
    json: json,
    callback: buildResultRequestCallback(
        statementContext, headers, onResultAvailable)
  },
  true);
}
function sendRequestPreExec(statementContext, onResultAvailable)
{
  // get the request headers
  var headers = statementContext.resultRequestHeaders;

  // build the basic json for the request
  var json =
  {
    disableOfflineChunks : false,
    sqlText              : statementContext.sqlText
  };

  // if binds are specified, build a binds map and include it in the request
  if (Util.exists(statementContext.binds))
  {
    json.bindings = buildBindsMap(statementContext.binds);
  }

  // include statement parameters if a value was specified
  if (Util.exists(statementContext.parameters))
  {
    json.parameters = statementContext.parameters;
  }

  // include the internal flag if a value was specified
  if (Util.exists(statementContext.internal))
  {
    json.isInternal = statementContext.internal;
  }

  // use the snowflake service to issue the request
  sendSfRequest(statementContext,
  {
    method  : 'POST',
    headers : headers,
    url     : Url.format(
    {
      pathname : '/queries/v1/query-request',
      search   : QueryString.stringify(
      {
        requestId: statementContext.requestId
      })
    }),
    json: json,
    callback: buildResultRequestCallback(
        statementContext, headers, onResultAvailable)
  },
  true);
}
function sendRequestPreExec ( statementContext , onResultAvailable ) { // get the request headers var headers = statementContext . resultRequestHeaders ; // build the basic json for the request var json = { disableOfflineChunks : false , sqlText : statementContext . sqlText } ; // if binds are specified, build a binds map and include it in the request if ( Util . exists ( statementContext . binds ) ) { json . bindings = buildBindsMap ( statementContext . binds ) ; } // include statement parameters if a value was specified if ( Util . exists ( statementContext . parameters ) ) { json . parameters = statementContext . parameters ; } // include the internal flag if a value was specified if ( Util . exists ( statementContext . internal ) ) { json . isInternal = statementContext . internal ; } // use the snowflake service to issue the request sendSfRequest ( statementContext , { method : 'POST' , headers : headers , url : Url . format ( { pathname : '/queries/v1/query-request' , search : QueryString . stringify ( { requestId : statementContext . requestId } ) } ) , json : json , callback : buildResultRequestCallback ( statementContext , headers , onResultAvailable ) } , true ) ; }
Issues a request to get the result of a statement that hasn't been previously
executed.

@param statementContext
@param onResultAvailable
Issues a request to get the result of a statement that hasn t been previously executed .