execQuery method

Uint8List? execQuery(
  1. int connectionId,
  2. String sql, {
  3. int? maxBufferBytes,
})

Executes a SQL query and returns binary result data.

The connectionId must be a valid active connection. The sql should be a valid SQL SELECT statement. When maxBufferBytes is set, caps the result buffer size; otherwise uses the package default.

Returns binary result data on success, null on failure.

Implementation

Uint8List? execQuery(int connectionId, String sql, {int? maxBufferBytes}) {
  return _withSql(
    sql,
    (ffi.Pointer<bindings.Utf8> sqlPtr) => callWithBuffer(
      (buf, bufLen, outWritten) => _bindings.odbc_exec_query(
        connectionId,
        sqlPtr,
        buf,
        bufLen,
        outWritten,
      ),
      maxSize: maxBufferBytes,
    ),
  );
}