prepareStatement method

  1. @override
void prepareStatement(
  1. TSQLCursor cursor,
  2. TSQLTransaction? aTransaction,
  3. String buf,
  4. TParams? aParams,
)
override

Implementation

@override
void prepareStatement(TSQLCursor cursor, TSQLTransaction? aTransaction,
    String buf, TParams? aParams) {
  final c = cursor as TWapCursor;
  var s = buf;
  c.paramBinding = <int>[];
  if (aParams != null && aParams.count > 0) {
    // Does parameter translation using the faithfully-translated DoParseSQL (handles comments/quotes/:: cast)
    s = aParams.parseSQL(s, false,
        escapeSlash: connOptions.contains(TConnOption.sqEscapeSlash),
        escapeRepeat: connOptions.contains(TConnOption.sqEscapeRepeat),
        parameterStyle: TParamStyle.psInterbase,
        paramBinding: c.paramBinding);
  }
  c.preparedSQL = s;
  // @@@ Whether it's queryable: a SELECT or a schema query
  c.fSelectable = c.fStatementType == TStatementType.stSelect ||
      c.fSchemaType != TSchemaType.stNoSchema;
  c.fPrepared = true;
}