unit uDAIBInterfaces; {----------------------------------------------------------------------------} { Data Abstract Library - Core Library } { } { compiler: Delphi 6 and up, Kylix 3 and up } { platform: Win32, Linux } { } { (c)opyright RemObjects Software. all rights reserved. } { } { Using this code requires a valid license of the Data Abstract } { which can be obtained at http://www.remobjects.com. } {----------------------------------------------------------------------------} {$I DataAbstract.inc} interface uses uROClasses, uDAInterfaces, uDAEngine; type { IDAInterbaseConnection For identification purposes. Implemented by all IB connections } IDAInterbaseConnection = interface(IDAConnection) ['{CE1B8144-4EA6-4815-ACD2-D5A4B62F2E69}'] end; { IDAIBTransactionAccess Interbase connections usually refer to a separate transaction object unlike all the rest of data access components. If implemented, this interfaces provides access to the inner transaction object. See implementation of IBX and IBO drivers. } IDAIBTransactionAccess = interface ['{C1BDDDD3-749A-4D25-BD1E-43715B697959}'] function GetTransaction: TObject; safecall; procedure Commit; safecall; procedure CommitRetaining; safecall; procedure Rollback; safecall; procedure RollbackRetaining; safecall; property Transaction: TObject read GetTransaction; end; { IDAIBConnectionProperties Provides access to common properties of Interbase connections } IDAIBConnectionProperties = interface ['{5F001B6F-4FB6-46B7-BC27-3326C4658F75}'] function GetRole: string; safecall; procedure SetRole(const Value: string); safecall; function GetSQLDialect: integer; safecall; procedure SetSQLDialect(Value: integer); safecall; function GetCharset: string; safecall; procedure SetCharset(const Value: string); safecall; procedure Commit; safecall; procedure CommitRetaining; safecall; procedure Rollback; safecall; procedure RollbackRetaining; safecall; property Role: string read GetRole write SetRole; property SQLDialect: integer read GetSQLDialect write SetSQLDialect; property Charset: string read GetCharset write SetCharset; end; TDAIBAuxParams = (ibxp_Role, ibxp_Dialect, ibxp_Charset); TDAIBDriver = class(TDAEDriver) protected procedure GetAuxParams(const AuxDriver: string; out List: IROStrings); override; function GetAvailableDriverOptions: TDAAvailableDriverOptions; override;safecall; function GetDefaultConnectionType(const AuxDriver: string): string; override; safecall; public end; TDAIBConnection = class(TDAEConnection, IDAConnection, IDAUseGenerators, IDAFileBasedDatabase, IDAInterbaseConnection,IDACanQueryGeneratorsNames) private protected function GetSQLDialect: integer; virtual; safecall;abstract; // IDAConnection procedure DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection); override; function GetSPSelectSyntax(HasArguments: Boolean): string; override; safecall; function CreateMacroProcessor: TDASQLMacroProcessor; override; function DoGetLastAutoInc(const GeneratorName: string): integer; override; function IdentifierNeedsQuoting(const iIdentifier: string): boolean; override;safecall; procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection); override; procedure DoGetTableNames(out List: IROStrings); override; procedure DoGetViewNames(out List: IROStrings); override; procedure DoGetStoredProcedureNames(out List: IROStrings); override; // IDAUseGenerators function GetNextAutoinc(const GeneratorName: string): integer; safecall; // IDAFileBasedDatabase function GetFileExtensions: IROStrings; // IDACanQueryGeneratorsNames function GetGeneratorNames: IROStrings; public end; const IBAuxParams: array[TDAIBAuxParams] of string = ( 'Role=', 'Dialect=1,2,3', 'Charset=ASCII,BIG_5,CYRL,DOS437,DOS850,DOS852,DOS857,DOS860,DOS861,DOS863, ' + 'DOS865,EUCJ_0208,GB_2312,ISO8859_1,ISO8859_2,KSC_5601,NEXT,NONE, ' + 'OCTETS,SJIS_0208,UNICODE_FSS,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254' ); const IB_DriverType = 'Interbase'; procedure AddIBAuxParams(const List: IROStrings); function IB_GetFileExtensions: IROStrings; procedure IB_GetTableFields(const aTableName: string; Query: IDADataset; out Fields: TDAFieldCollection); function IB_GetSPSelectSyntax(HasArguments: Boolean): String; function IB_GetNextAutoinc(const GeneratorName: string; Query: IDADataset): integer; function IB_GetLastAutoInc(const GeneratorName: string; Query: IDADataset): integer; function IB_CreateMacroProcessor: TDASQLMacroProcessor; Procedure IB_DoGetForeignKeys(Query: IDADataset;ForeignKeys: TDADriverForeignKeyCollection); procedure IB_GetObjectNames(Query: IDADataset;AList: IROStrings; AObjectType: TDAObjecttype); function IB_IdentifierNeedsQuoting(const iIdentifier: string; ASQLDialect: integer =1): boolean; function IB_GetGeneratorNames(Query: IDADataset):IROStrings; implementation uses SysUtils, uDAMacroProcessors; var ib_reservedwords: array of string; procedure AddIBAuxParams(const List: IROStrings); var x: TDAIBAuxParams; begin for x := Low(TDAIBAuxParams) to High(TDAIBAuxParams) do List.Add(IBAuxParams[x]) end; function IB_GetFileExtensions: IROStrings; begin result := TROStrings.Create; result.Add('*.fdb;Firebird Database (*.fdb)'); result.Add('*.gdb;Interbase Database (*.gdb)'); result.Add('*.*;All files (*.*)'); end; procedure IB_GetTableFields(const aTableName: string; Query: IDADataset; out Fields: TDAFieldCollection); const IBSQL_TableInfo = 'select a.rdb$field_name,a.rdb$null_flag, '+ 'b.rdb$field_precision, b.rdb$field_scale, ' + 'b.rdb$null_flag, b.rdb$computed_source '+ 'from rdb$relation_fields a '+ 'left join RDB$FIELDS b on (a.rdb$field_source = b.rdb$field_name) '+ 'where (a.rdb$relation_name = ''%s'')'; IBSQL_PRIMARYKEY = 'select d.rdb$field_name from rdb$relation_constraints c '+ 'left join rdb$index_segments d on (c.rdb$index_name = d.rdb$index_name) '+ 'where (c.rdb$relation_name = ''%s'') and (c.rdb$constraint_type = ''PRIMARY KEY'')'; var fld: TDAField; begin Fields := TDAFieldCollection.Create(nil); try // main info Query.SQL := 'SELECT * FROM ' + aTableName; Query.Open; Fields.Assign(Query.Fields); // required Query.Close; Query.SQL := Format(IBSQL_TableInfo,[aTableName]); Query.Open; While not Query.Eof do begin fld := Fields.FindField(Trim(Query.Fields[0].AsString)); if Fld <> nil then begin if Query.Fields[1].IsNull then Fld.Required:=(Query.Fields[4].AsInteger = 1) else Fld.Required:=(Query.Fields[1].AsInteger = 1); if fld.DataType = datDecimal then begin fld.DecimalPrecision:=Query.Fields[2].AsInteger; fld.DecimalScale:=ABS(Query.Fields[3].AsInteger); end; if not Query.Fields[2].IsNull then begin fld.ReadOnly:= True; fld.LogChanges:= False; end; end; Query.Next; end; // pk Query.Close; Query.SQL:= Format(IBSQL_PRIMARYKEY,[aTableName]); Query.Open; While not Query.Eof do begin fld := Fields.FindField(Trim(Query.Fields[0].AsString)); if Fld <> nil then begin fld.InPrimaryKey := True; fld.Required := True; end; Query.Next; end; finally Query := nil; end; end; function IB_GetSPSelectSyntax(HasArguments: Boolean): String; begin if HasArguments then Result := 'SELECT * FROM {0}({1})' else Result := 'SELECT * FROM {0}'; end; function IB_GetNextAutoinc(const GeneratorName: string; Query: IDADataset): integer; begin try Query.SQL:=Format('SELECT Gen_id(%s,1) FROM RDB$Database', [GeneratorName]); Query.Open; Result := Query.Fields[0].AsInteger; finally Query:=nil; end; end; function IB_GetLastAutoInc(const GeneratorName: string;Query: IDADataset): integer; begin try Query.SQL:=Format('SELECT Gen_id(%s,0) FROM RDB$Database', [GeneratorName]); Query.Open; Result := Query.Fields[0].AsInteger; finally Query:=nil; end; end; function IB_CreateMacroProcessor: TDASQLMacroProcessor; begin result := TDAIBMacroProcessor.Create; end; Procedure IB_DoGetForeignKeys(Query: IDADataset;ForeignKeys: TDADriverForeignKeyCollection); var lCurrConstraint: string; lCurrFK: TDADriverForeignKey; const sFK_SQL = 'SELECT A.RDB$CONSTRAINT_NAME, A.RDB$RELATION_NAME AS TABLE_NAME, ' + //A.RDB$CONSTRAINT_NAME AS FK_NAME, B.RDB$UPDATE_RULE AS UR, B.RDB$DELETE_RULE AS DR,'+ 'C.RDB$RELATION_NAME AS FK_TABLE, D.RDB$FIELD_NAME AS FK_FIELD, ' + 'E.RDB$FIELD_NAME AS ONFIELD ' + 'FROM ' + 'RDB$RELATION_CONSTRAINTS A JOIN RDB$REF_CONSTRAINTS B ON (A.RDB$CONSTRAINT_NAME = B.RDB$CONSTRAINT_NAME) ' + 'JOIN RDB$RELATION_CONSTRAINTS C ON (B.RDB$CONST_NAME_UQ=C.RDB$CONSTRAINT_NAME)' + 'JOIN RDB$INDEX_SEGMENTS D ON (C.RDB$INDEX_NAME=D.RDB$INDEX_NAME) ' + 'JOIN RDB$INDEX_SEGMENTS E ON (A.RDB$INDEX_NAME=E.RDB$INDEX_NAME) AND (D.RDB$FIELD_POSITION = E.RDB$FIELD_POSITION) ' + 'WHERE (A.RDB$CONSTRAINT_TYPE = ''FOREIGN KEY'') ' + 'ORDER BY A.RDB$CONSTRAINT_NAME, A.RDB$RELATION_NAME, D.RDB$FIELD_POSITION, E.RDB$FIELD_POSITION '; begin lCurrConstraint := ''; lCurrFK := nil; try Query.SQL := sFK_SQL; Query.Open; ForeignKeys.Clear; while (not Query.EOF) do begin if lCurrConstraint <> Query.Fields[0].AsString then begin lCurrConstraint := Query.Fields[0].AsString; lCurrFK := ForeignKeys.Add(); with lCurrFK do begin FKField := TrimRight(Query.Fields[4].AsString); PKField := TrimRight(Query.Fields[3].AsString); FKTable := TrimRight(Query.Fields[1].AsString); PKTable := TrimRight(Query.Fields[2].AsString); end; end else begin with lCurrFK do begin FKField := FKField + ';' + TrimRight(Query.Fields[4].AsString); PKField := PKField + ';' + TrimRight(Query.Fields[3].AsString); end; end; Query.Next; end; finally Query := nil; end; end; procedure IB_GetObjectNames(Query: IDADataset;AList: IROStrings; AObjectType: TDAObjecttype); begin try case AObjectType of dotTable: Query.SQL := 'Select RDB$RELATION_NAME from RDB$RELATIONS WHERE (RDB$VIEW_BLR is NULL) AND (RDB$SYSTEM_FLAG = 0) ORDER BY 1'; dotProcedure: Query.SQL := 'Select RDB$PROCEDURE_NAME from RDB$PROCEDURES ORDER BY 1'; dotView: Query.SQL := 'Select RDB$RELATION_NAME from RDB$RELATIONS WHERE (RDB$VIEW_BLR is not NULL) ORDER BY 1'; else end; Query.Open; while not Query.EOF do begin AList.Add(Trim(Query.Fields[0].AsString)); Query.Next; end; finally Query:=nil; end; end; function IB_IdentifierNeedsQuoting(const iIdentifier: string; ASQLDialect: integer = 1): boolean; var L,H,I, r: Integer; begin if (ASQLDialect >= 3) then for i := 1 to Length(iIdentifier) do begin Result:= not (iIdentifier[i] in ['A'..'Z', '0'..'9', '_']); if Result then Exit; end; Result := pos('.', iIdentifier) > 0; if Result then Exit; l := 0; h := Length(ib_reservedwords) -1; while l <= h do begin i := (L + H) shr 1; r := CompareText(iIdentifier, ib_reservedwords[i]); if r < 0 then h := i - 1 else if r > 0 then l := i + 1 else begin result := true; exit; end; end; end; function IB_GetGeneratorNames(Query: IDADataset):IROStrings; const sql = 'SELECT RDB$GENERATOR_NAME FROM RDB$GENERATORS WHERE RDB$SYSTEM_FLAG = 0 ORDER BY RDB$GENERATOR_NAME'; begin Result:= NewROStrings; try Query.SQL := sql; Query.Open; while not Query.EOF do begin Result.Add(Trim(Query.Fields[0].AsString)); Query.Next; end; finally Query:=nil; end; end; { TDAIBConnection } function TDAIBConnection.CreateMacroProcessor: TDASQLMacroProcessor; begin result := IB_CreateMacroProcessor; end; procedure TDAIBConnection.DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection); begin inherited; IB_DoGetForeignKeys(GetDatasetClass.Create(Self),ForeignKeys); end; function TDAIBConnection.DoGetLastAutoInc(const GeneratorName: string): integer; begin Result:= IB_GetLastAutoInc(GeneratorName,GetDatasetClass.Create(Self)); end; procedure TDAIBConnection.DoGetStoredProcedureNames(out List: IROStrings); begin inherited; IB_GetObjectNames(GetDatasetClass.Create(Self),List,dotProcedure); end; procedure TDAIBConnection.DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection); begin IB_GetTableFields(QuoteIdentifierIfNeeded(aTableName),GetDatasetClass.Create(Self),Fields); end; procedure TDAIBConnection.DoGetTableNames(out List: IROStrings); begin inherited; IB_GetObjectNames(GetDatasetClass.Create(Self),List,dotTable); end; procedure TDAIBConnection.DoGetViewNames(out List: IROStrings); begin inherited; IB_GetObjectNames(GetDatasetClass.Create(Self),List,dotView); end; function TDAIBConnection.GetFileExtensions: IROStrings; begin Result:= IB_GetFileExtensions; end; function TDAIBConnection.GetGeneratorNames: IROStrings; begin Result:= IB_GetGeneratorNames(GetDatasetClass.Create(Self)); end; function TDAIBConnection.GetNextAutoinc(const GeneratorName: string): integer; begin Result:= IB_GetNextAutoinc(GeneratorName,GetDatasetClass.Create(Self)); end; function TDAIBConnection.GetSPSelectSyntax(HasArguments: Boolean): string; begin Result:= IB_GetSPSelectSyntax(HasArguments); end; function TDAIBConnection.IdentifierNeedsQuoting(const iIdentifier: string): boolean; begin result := inherited IdentifierNeedsQuoting(iIdentifier); if not result and (GetSQLDialect >= 3) then result := IB_IdentifierNeedsQuoting(iIdentifier,GetSQLDialect); end; { TDAIBDriver } procedure TDAIBDriver.GetAuxParams(const AuxDriver: string; out List: IROStrings); begin inherited; AddIBAuxParams(List); end; function TDAIBDriver.GetAvailableDriverOptions: TDAAvailableDriverOptions; begin result := [doServerName, doDatabaseName, doLogin, doCustom]; end; function TDAIBDriver.GetDefaultConnectionType(const AuxDriver: string): string; begin Result:= IB_DriverType; end; procedure ib_InitializeReservedWords; begin SetLength(ib_reservedwords, 281); ib_reservedwords[0] := 'ACTION'; ib_reservedwords[1] := 'ACTIVE'; ib_reservedwords[2] := 'ADD'; ib_reservedwords[3] := 'ADMIN'; ib_reservedwords[4] := 'AFTER'; ib_reservedwords[5] := 'ALL'; ib_reservedwords[6] := 'ALTER'; ib_reservedwords[7] := 'AND'; ib_reservedwords[8] := 'ANY'; ib_reservedwords[9] := 'AS'; ib_reservedwords[10] := 'ASC'; ib_reservedwords[11] := 'ASCENDING'; ib_reservedwords[12] := 'AT'; ib_reservedwords[13] := 'AUTO'; ib_reservedwords[14] := 'AUTODDL'; ib_reservedwords[15] := 'AVG'; ib_reservedwords[16] := 'BASED'; ib_reservedwords[17] := 'BASENAME'; ib_reservedwords[18] := 'BASE_NAME'; ib_reservedwords[19] := 'BEFORE'; ib_reservedwords[20] := 'BEGIN'; ib_reservedwords[21] := 'BETWEEN'; ib_reservedwords[22] := 'BLOB'; ib_reservedwords[23] := 'BLOBEDIT'; ib_reservedwords[24] := 'BUFFER'; ib_reservedwords[25] := 'BY'; ib_reservedwords[26] := 'CACHE'; ib_reservedwords[27] := 'CASCADE'; ib_reservedwords[28] := 'CAST'; ib_reservedwords[29] := 'CHAR'; ib_reservedwords[30] := 'CHARACTER'; ib_reservedwords[31] := 'CHARACTER_LENGTH'; ib_reservedwords[32] := 'CHAR_LENGTH'; ib_reservedwords[33] := 'CHECK'; ib_reservedwords[34] := 'CHECK_POINT_LEN'; ib_reservedwords[35] := 'CHECK_POINT_LENGTH'; ib_reservedwords[36] := 'COLLATE'; ib_reservedwords[37] := 'COLLATION'; ib_reservedwords[38] := 'COLUMN'; ib_reservedwords[39] := 'COMMIT'; ib_reservedwords[40] := 'COMMITTED'; ib_reservedwords[41] := 'COMPILETIME'; ib_reservedwords[42] := 'COMPUTED'; ib_reservedwords[43] := 'CLOSE'; ib_reservedwords[44] := 'CONDITIONAL'; ib_reservedwords[45] := 'CONNECT'; ib_reservedwords[46] := 'CONSTRAINT'; ib_reservedwords[47] := 'CONTAINING'; ib_reservedwords[48] := 'CONTINUE'; ib_reservedwords[49] := 'COUNT'; ib_reservedwords[50] := 'CREATE'; ib_reservedwords[51] := 'CSTRING'; ib_reservedwords[52] := 'CURRENT'; ib_reservedwords[53] := 'CURRENT_DATE'; ib_reservedwords[54] := 'CURRENT_TIME'; ib_reservedwords[55] := 'CURRENT_TIMESTAMP'; ib_reservedwords[56] := 'CURSOR'; ib_reservedwords[57] := 'DATABASE'; ib_reservedwords[58] := 'DATE'; ib_reservedwords[59] := 'DAY'; ib_reservedwords[60] := 'DB_KEY'; ib_reservedwords[61] := 'DEBUG'; ib_reservedwords[62] := 'DEC'; ib_reservedwords[63] := 'DECIMAL'; ib_reservedwords[64] := 'DECLARE'; ib_reservedwords[65] := 'DEFAULT'; ib_reservedwords[66] := 'DELETE'; ib_reservedwords[67] := 'DESC'; ib_reservedwords[68] := 'DESCENDING'; ib_reservedwords[69] := 'DESCRIBE'; ib_reservedwords[70] := 'DESCRIPTOR'; ib_reservedwords[71] := 'DISCONNECT'; ib_reservedwords[72] := 'DISPLAY'; ib_reservedwords[73] := 'DISTINCT'; ib_reservedwords[74] := 'DO'; ib_reservedwords[75] := 'DOMAIN'; ib_reservedwords[76] := 'DOUBLE'; ib_reservedwords[77] := 'DROP'; ib_reservedwords[78] := 'ECHO'; ib_reservedwords[79] := 'EDIT'; ib_reservedwords[80] := 'ELSE'; ib_reservedwords[81] := 'END'; ib_reservedwords[82] := 'ENTRY_POINT'; ib_reservedwords[83] := 'ESCAPE'; ib_reservedwords[84] := 'EVENT'; ib_reservedwords[85] := 'EXCEPTION'; ib_reservedwords[86] := 'EXECUTE'; ib_reservedwords[87] := 'EXISTS'; ib_reservedwords[88] := 'EXIT'; ib_reservedwords[89] := 'EXTERN'; ib_reservedwords[90] := 'EXTERNAL'; ib_reservedwords[91] := 'EXTRACT'; ib_reservedwords[92] := 'FETCH'; ib_reservedwords[93] := 'FILE'; ib_reservedwords[94] := 'FILTER'; ib_reservedwords[95] := 'FLOAT'; ib_reservedwords[96] := 'FOR'; ib_reservedwords[97] := 'FOREIGN'; ib_reservedwords[98] := 'FOUND'; ib_reservedwords[99] := 'FREE_IT'; ib_reservedwords[100] := 'FROM'; ib_reservedwords[101] := 'FULL'; ib_reservedwords[102] := 'FUNCTION'; ib_reservedwords[103] := 'GDSCODE'; ib_reservedwords[104] := 'GENERATOR'; ib_reservedwords[105] := 'GEN_ID'; ib_reservedwords[106] := 'GLOBAL'; ib_reservedwords[107] := 'GOTO'; ib_reservedwords[108] := 'GRANT'; ib_reservedwords[109] := 'GROUP'; ib_reservedwords[110] := 'GROUP_COMMIT_WAIT'; ib_reservedwords[111] := 'GROUP_COMMIT_'; ib_reservedwords[112] := 'WAIT_TIME'; ib_reservedwords[113] := 'HAVING'; ib_reservedwords[114] := 'HELP'; ib_reservedwords[115] := 'HOUR'; ib_reservedwords[116] := 'IF'; ib_reservedwords[117] := 'IMMEDIATE'; ib_reservedwords[118] := 'IN'; ib_reservedwords[119] := 'INACTIVE'; ib_reservedwords[120] := 'INDEX'; ib_reservedwords[121] := 'INDICATOR'; ib_reservedwords[122] := 'INIT'; ib_reservedwords[123] := 'INNER'; ib_reservedwords[124] := 'INPUT'; ib_reservedwords[125] := 'INPUT_TYPE'; ib_reservedwords[126] := 'INSERT'; ib_reservedwords[127] := 'INT'; ib_reservedwords[128] := 'INTEGER'; ib_reservedwords[129] := 'INTO'; ib_reservedwords[130] := 'IS'; ib_reservedwords[131] := 'ISOLATION'; ib_reservedwords[132] := 'ISQL'; ib_reservedwords[133] := 'JOIN'; ib_reservedwords[134] := 'KEY'; ib_reservedwords[135] := 'LC_MESSAGES'; ib_reservedwords[136] := 'LC_TYPE'; ib_reservedwords[137] := 'LEFT'; ib_reservedwords[138] := 'LENGTH'; ib_reservedwords[139] := 'LEV'; ib_reservedwords[140] := 'LEVEL'; ib_reservedwords[141] := 'LIKE'; ib_reservedwords[142] := 'LOGFILE'; ib_reservedwords[143] := 'LOG_BUFFER_SIZE'; ib_reservedwords[144] := 'LOG_BUF_SIZE'; ib_reservedwords[145] := 'LONG'; ib_reservedwords[146] := 'MANUAL'; ib_reservedwords[147] := 'MAX'; ib_reservedwords[148] := 'MAXIMUM'; ib_reservedwords[149] := 'MAXIMUM_SEGMENT'; ib_reservedwords[150] := 'MAX_SEGMENT'; ib_reservedwords[151] := 'MERGE'; ib_reservedwords[152] := 'MESSAGE'; ib_reservedwords[153] := 'MIN'; ib_reservedwords[154] := 'MINIMUM'; ib_reservedwords[155] := 'MINUTE'; ib_reservedwords[156] := 'MODULE_NAME'; ib_reservedwords[157] := 'MONTH'; ib_reservedwords[158] := 'NAMES'; ib_reservedwords[159] := 'NATIONAL'; ib_reservedwords[160] := 'NATURAL'; ib_reservedwords[161] := 'NCHAR'; ib_reservedwords[162] := 'NO'; ib_reservedwords[163] := 'NOAUTO'; ib_reservedwords[164] := 'NOT'; ib_reservedwords[165] := 'NULL'; ib_reservedwords[166] := 'NUMERIC'; ib_reservedwords[167] := 'NUM_LOG_BUFS'; ib_reservedwords[168] := 'NUM_LOG_BUFFERS'; ib_reservedwords[169] := 'OCTET_LENGTH'; ib_reservedwords[170] := 'OF'; ib_reservedwords[171] := 'ON'; ib_reservedwords[172] := 'ONLY'; ib_reservedwords[173] := 'OPEN'; ib_reservedwords[174] := 'OPTION'; ib_reservedwords[175] := 'OR'; ib_reservedwords[176] := 'ORDER'; ib_reservedwords[177] := 'OUTER'; ib_reservedwords[178] := 'OUTPUT'; ib_reservedwords[179] := 'OUTPUT_TYPE'; ib_reservedwords[180] := 'OVERFLOW'; ib_reservedwords[181] := 'PAGE'; ib_reservedwords[182] := 'PAGELENGTH'; ib_reservedwords[183] := 'PAGES'; ib_reservedwords[184] := 'PAGE_SIZE'; ib_reservedwords[185] := 'PARAMETER'; ib_reservedwords[186] := 'PASSWORD'; ib_reservedwords[187] := 'PLAN'; ib_reservedwords[188] := 'POSITION'; ib_reservedwords[189] := 'POST_EVENT'; ib_reservedwords[190] := 'PRECISION'; ib_reservedwords[191] := 'PREPARE'; ib_reservedwords[192] := 'PROCEDURE'; ib_reservedwords[193] := 'PROTECTED'; ib_reservedwords[194] := 'PRIMARY'; ib_reservedwords[195] := 'PRIVILEGES'; ib_reservedwords[196] := 'PUBLIC'; ib_reservedwords[197] := 'QUIT'; ib_reservedwords[198] := 'RAW_PARTITIONS'; ib_reservedwords[199] := 'RDB$DB_KEY'; ib_reservedwords[200] := 'READ'; ib_reservedwords[201] := 'REAL'; ib_reservedwords[202] := 'RECORD_VERSION'; ib_reservedwords[203] := 'REFERENCES'; ib_reservedwords[204] := 'RELEASE'; ib_reservedwords[205] := 'RESERV'; ib_reservedwords[206] := 'RESERVING'; ib_reservedwords[207] := 'RESTRICT'; ib_reservedwords[208] := 'RETAIN'; ib_reservedwords[209] := 'RETURN'; ib_reservedwords[210] := 'RETURNING_VALUES'; ib_reservedwords[211] := 'RETURNS'; ib_reservedwords[212] := 'REVOKE'; ib_reservedwords[213] := 'RIGHT'; ib_reservedwords[214] := 'ROLE'; ib_reservedwords[215] := 'ROLLBACK'; ib_reservedwords[216] := 'RUNTIME'; ib_reservedwords[217] := 'SCHEMA'; ib_reservedwords[218] := 'SECOND'; ib_reservedwords[219] := 'SEGMENT'; ib_reservedwords[220] := 'SELECT'; ib_reservedwords[221] := 'SET'; ib_reservedwords[222] := 'SHADOW'; ib_reservedwords[223] := 'SHARED'; ib_reservedwords[224] := 'SHELL'; ib_reservedwords[225] := 'SHOW'; ib_reservedwords[226] := 'SINGULAR'; ib_reservedwords[227] := 'SIZE'; ib_reservedwords[228] := 'SMALLINT'; ib_reservedwords[229] := 'SNAPSHOT'; ib_reservedwords[230] := 'SOME'; ib_reservedwords[231] := 'SORT'; ib_reservedwords[232] := 'SQLCODE'; ib_reservedwords[233] := 'SQLERROR'; ib_reservedwords[234] := 'SQLWARNING'; ib_reservedwords[235] := 'STABILITY'; ib_reservedwords[236] := 'STARTING'; ib_reservedwords[237] := 'STARTS'; ib_reservedwords[238] := 'STATEMENT'; ib_reservedwords[239] := 'STATIC'; ib_reservedwords[240] := 'STATISTICS'; ib_reservedwords[241] := 'SUB_TYPE'; ib_reservedwords[242] := 'SUM'; ib_reservedwords[243] := 'SUSPEND'; ib_reservedwords[244] := 'TABLE'; ib_reservedwords[245] := 'TERMINATOR'; ib_reservedwords[246] := 'THEN'; ib_reservedwords[247] := 'TIME'; ib_reservedwords[248] := 'TIMESTAMP'; ib_reservedwords[249] := 'TO'; ib_reservedwords[250] := 'TRANSACTION'; ib_reservedwords[251] := 'TRANSLATE'; ib_reservedwords[252] := 'TRANSLATION'; ib_reservedwords[253] := 'TRIGGER'; ib_reservedwords[254] := 'TRIM'; ib_reservedwords[255] := 'TYPE'; ib_reservedwords[256] := 'UNCOMMITTED'; ib_reservedwords[257] := 'UNION'; ib_reservedwords[258] := 'UNIQUE'; ib_reservedwords[259] := 'UPDATE'; ib_reservedwords[260] := 'UPPER'; ib_reservedwords[261] := 'USER'; ib_reservedwords[262] := 'USING'; ib_reservedwords[263] := 'VALUE'; ib_reservedwords[264] := 'VALUES'; ib_reservedwords[265] := 'VARCHAR'; ib_reservedwords[266] := 'VARIABLE'; ib_reservedwords[267] := 'VARYING'; ib_reservedwords[268] := 'VERSION'; ib_reservedwords[269] := 'VIEW'; ib_reservedwords[270] := 'WAIT'; ib_reservedwords[271] := 'WEEKDAY'; ib_reservedwords[272] := 'WHEN'; ib_reservedwords[273] := 'WHENEVER'; ib_reservedwords[274] := 'WHERE'; ib_reservedwords[275] := 'WHILE'; ib_reservedwords[276] := 'WITH'; ib_reservedwords[277] := 'WORK'; ib_reservedwords[278] := 'WRITE'; ib_reservedwords[279] := 'YEAR'; ib_reservedwords[280] := 'YEARDAY'; end; initialization ib_InitializeReservedWords; finalization ib_reservedwords := nil; end.