prepare method

int prepare(
  1. int connectionId,
  2. String sql, {
  3. int timeoutMs = 0,
})

Prepares a SQL statement for execution.

The connectionId must be a valid active connection. The sql should be a parameterized SQL statement. The timeoutMs specifies the statement timeout in milliseconds (0 = no timeout).

Returns a statement ID on success, 0 on failure.

Implementation

int prepare(int connectionId, String sql, {int timeoutMs = 0}) {
  return _withSql<int>(
        sql,
        (sqlPtr) => _bindings.odbc_prepare(connectionId, sqlPtr, timeoutMs),
      ) ??
      0;
}