--- ibx/trunk/fbintf/IB.pas 2021/06/09 12:07:56 338 +++ ibx/trunk/fbintf/IB.pas 2021/08/23 14:22:29 345 @@ -134,9 +134,9 @@ uses const {Interface version information} FBIntf_Major = 1; - FBIntf_Minor = 2; + FBIntf_Minor = 3; FBIntf_Release = 1; - FBIntf_Version = '1.2.1'; + FBIntf_Version = '1.3.1'; const {DPB, TPB and SPB Parameter Block Name Prefixes} @@ -263,7 +263,8 @@ type IParameterBlockWithTypeNames<_IItem> = interface(IParameterBlock<_IItem>) function AddByTypeName(ParamTypeName: AnsiString): _IItem; - function GetDPBParamTypeName(ParamType: byte): Ansistring; + function GetDPBParamTypeName(ParamType: byte): Ansistring; deprecated 'Use Get ParamTypeName'; + function GetParamTypeName(ParamType: byte): Ansistring; end; {IParameterBlockItem is not used on its own but instead provides a base type for @@ -300,10 +301,12 @@ type TIBDataBaseErrorMessages = set of TIBDataBaseErrorMessage; + TStatusCode = long; + IStatus = interface ['{34167722-af38-4831-b08a-93162d58ede3}'] - function GetIBErrorCode: Long; - function Getsqlcode: Long; + function GetIBErrorCode: TStatusCode; + function Getsqlcode: TStatusCode; function GetMessage: AnsiString; function CheckStatusVector(ErrorCodes: array of TFBStatusCode): Boolean; function GetIBDataBaseErrorMessages: TIBDataBaseErrorMessages; @@ -747,6 +750,19 @@ type TPerfCounters = array[TPerfStats] of Int64; + {Batch Query Execution Support} + + TBatchCompletionState = (bcExecuteFailed, bcSuccessNoInfo, bcNoMoreErrors); + + IBatchCompletion = interface + ['{9bc3d49d-16d9-4606-94e5-ee987103ad92}'] + function getTotalProcessed: cardinal; + function getState(updateNo: cardinal): TBatchCompletionState; + function getStatusMessage(updateNo: cardinal): AnsiString; + function getUpdated: integer; + function getErrorStatus(var RowNo: integer; var status: IStatus): boolean; + end; + {The IStatement interface provides access to an SQL Statement once it has been initially prepared. The interface is returned from the IAttachment interface. } @@ -758,10 +774,13 @@ type function GetPlan: AnsiString; function GetRowsAffected(var SelectCount, InsertCount, UpdateCount, DeleteCount: integer): boolean; function GetSQLStatementType: TIBSQLStatementTypes; + function GetSQLStatementTypeName: AnsiString; function GetSQLText: AnsiString; function GetProcessedSQLText: AnsiString; function GetSQLDialect: integer; function IsPrepared: boolean; + function HasBatchMode: boolean; + function IsInBatchMode: boolean; procedure Prepare(aTransaction: ITransaction=nil); function Execute(aTransaction: ITransaction=nil): IResults; function OpenCursor(aTransaction: ITransaction=nil): IResultSet; @@ -770,6 +789,14 @@ type procedure SetRetainInterfaces(aValue: boolean); procedure EnableStatistics(aValue: boolean); function GetPerfStatistics(var stats: TPerfCounters): boolean; + {IBatch interface support} + procedure AddToBatch; + function ExecuteBatch(aTransaction: ITransaction=nil): IBatchCompletion; + procedure CancelBatch; + function GetBatchCompletion: IBatchCompletion; + function GetBatchRowLimit: integer; + procedure SetBatchRowLimit(aLimit: integer); + property MetaData: IMetaData read GetMetaData; property SQLParams: ISQLParams read GetSQLParams; property SQLStatementType: TIBSQLStatementTypes read GetSQLStatementType; @@ -919,7 +946,7 @@ type function getSize: integer; procedure getRawBytes(var Buffer); function getAsString: AnsiString; - function getAsInteger: integer; + function getAsInteger: int64; procedure DecodeIDCluster(var ConnectionType: integer; var DBFileName, DBSiteName: AnsiString); function getAsBytes: TByteArray; function getAsDateTime: TDateTime; @@ -931,7 +958,7 @@ type function GetCount: integer; function GetItem(index: integer): IDBInfoItem; function Find(ItemType: byte): IDBInfoItem; - property AsInteger: integer read getAsInteger; + property AsInteger: int64 read getAsInteger; property AsString: AnsiString read GetAsString; property Count: integer read GetCount; property Items[index: integer]: IDBInfoItem read getItem; default; @@ -1064,6 +1091,8 @@ type function CreateBlob(transaction: ITransaction; SubType: integer; CharSetID: cardinal=0; BPB: IBPB=nil): IBlob; overload; function OpenBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload; function OpenBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload; + function GetInlineBlobLimit: integer; + procedure SetInlineBlobLimit(limit: integer); {Array - may use to open existing arrays. However, ISQLData.AsArray is preferred} @@ -1091,6 +1120,7 @@ type procedure getFBVersion(version: TStrings); function HasActivity: boolean; function HasDecFloatSupport: boolean; + function HasBatchMode: boolean; {Character Sets} function HasDefaultCharSet: boolean; @@ -1187,11 +1217,11 @@ type function getSize: integer; procedure getRawBytes(var Buffer); function getAsString: AnsiString; - function getAsInteger: integer; + function getAsInteger: int64; function getAsByte: byte; function CopyTo(stream: TStream; count: integer): integer; property AsString: AnsiString read getAsString; - property AsInteger: integer read getAsInteger; + property AsInteger: int64 read getAsInteger; property AsByte: byte read getAsByte; end; @@ -1334,6 +1364,9 @@ type {IB Client Exceptions} EIBClientError = class(EIBError); + {Used to explicitly report a Batch Buffer overflow} + EIBBatchBufferOverflow = class(EIBError); + {The Firebird API function is used to access the IFirebirdAPI interface. It will load the Firebird Client Library if this is not already loaded and