Code: Select all
procedure PrepareOracleStatement(PlainDriver: IZOraclePlainDriver;
SQL: string; Handle: POCIStmt; ErrorHandle: POCIError);
var
Status: Integer;
PrefetchCount: ub4;
begin
PrefetchCount := 100;
PlainDriver.AttrSet(Handle, OCI_HTYPE_STMT, @PrefetchCount, SizeOf(ub4),
OCI_ATTR_PREFETCH_ROWS, ErrorHandle);
Status := PlainDriver.StmtPrepare(Handle, ErrorHandle, PAnsiChar(AnsiString(SQL)),
Length(AnsiString(SQL)), OCI_NTV_SYNTAX, OCI_DEFAULT);
CheckOracleError(PlainDriver, ErrorHandle, Status, lcExecute, SQL);
end;
Of course, it is a bad idea to hardcode this in the source, but it would be nice to have this option as it can dramatically improve Oracle performance.