129 |
|
Classes, |
130 |
|
{$IFDEF WINDOWS}Windows, {$ENDIF} |
131 |
|
{$IFDEF FPC} Dynlibs, {$ENDIF} |
132 |
< |
SysUtils, DB, FBMessages, IBExternals; |
132 |
> |
SysUtils, DB, FBMessages, IBExternals, FmtBcd; |
133 |
|
|
134 |
|
const |
135 |
|
{Interface version information} |
136 |
|
FBIntf_Major = 1; |
137 |
< |
FBIntf_Minor = 1; |
138 |
< |
FBIntf_Release = 6; |
139 |
< |
FBIntf_Version = '1.1.6'; |
137 |
> |
FBIntf_Minor = 3; |
138 |
> |
FBIntf_Release = 2; |
139 |
> |
FBIntf_Version = '1.3.2'; |
140 |
> |
|
141 |
> |
const |
142 |
> |
{DPB, TPB and SPB Parameter Block Name Prefixes} |
143 |
> |
DPBPrefix = 'isc_dpb_'; |
144 |
> |
TPBPrefix = 'isc_tpb_'; |
145 |
> |
|
146 |
> |
const |
147 |
> |
{Time Zone ID constraint} |
148 |
> |
MaxOffsetTimeZoneID = 2879; {lower values represent a time zone offset between |
149 |
> |
-23:59 and 23:59. Higher values are keys to the |
150 |
> |
Time Zone database.} |
151 |
> |
|
152 |
> |
TimeZoneID_GMT = 23*minsPerHour + 59; |
153 |
> |
decimillisecondsPerSecond = 10000; |
154 |
> |
TimeZoneDisplacementDelta = 60*23 + 59; {23:59 in minutes} |
155 |
|
|
156 |
|
{These include files are converted from the 'C' originals in the Firebird API |
157 |
|
and define the various constants used by the API} |
158 |
|
|
159 |
|
{$I 'include/consts_pub.inc'} |
160 |
+ |
{$I 'include/dyn_consts.inc'} |
161 |
|
{$I 'include/inf_pub.inc'} |
162 |
|
{$I 'include/configkeys.inc'} |
163 |
+ |
{$I 'include/blr.inc'} |
164 |
|
|
165 |
|
{The following constants define the values return by calls to the GetSQLType |
166 |
|
methods provided by several of the interfaces defined below.} |
182 |
|
SQL_TYPE_TIME = 560; |
183 |
|
SQL_TYPE_DATE = 570; |
184 |
|
SQL_INT64 = 580; |
185 |
+ |
SQL_TIMESTAMP_TZ_EX = 32748; |
186 |
+ |
SQL_TIME_TZ_EX = 32750; |
187 |
+ |
SQL_INT128 = 32752; |
188 |
|
SQL_BOOLEAN = 32764; |
189 |
+ |
SQL_TIMESTAMP_TZ = 32754; |
190 |
+ |
SQL_TIME_TZ = 32756; |
191 |
+ |
SQL_DEC_FIXED = 32758; {FB4 Beta 1 only} |
192 |
+ |
SQL_DEC16 = 32760; |
193 |
+ |
SQL_DEC34 = 32762; |
194 |
+ |
SQL_NULL = 32766; |
195 |
|
SQL_DATE = SQL_TIMESTAMP; |
196 |
|
|
197 |
|
type |
241 |
|
|
242 |
|
TFBStatusCode = cardinal; |
243 |
|
TByteArray = array of byte; |
244 |
+ |
TFBTimeZoneID = ISC_USHORT; |
245 |
|
|
246 |
|
IFirebirdAPI = interface; |
247 |
|
IAttachment = interface; |
261 |
|
property Items[index: integer]: _IItem read getItems; default; |
262 |
|
end; |
263 |
|
|
264 |
+ |
IParameterBlockWithTypeNames<_IItem> = interface(IParameterBlock<_IItem>) |
265 |
+ |
function AddByTypeName(ParamTypeName: AnsiString): _IItem; |
266 |
+ |
function GetDPBParamTypeName(ParamType: byte): Ansistring; deprecated 'Use Get ParamTypeName'; |
267 |
+ |
function GetParamTypeName(ParamType: byte): Ansistring; |
268 |
+ |
end; |
269 |
+ |
|
270 |
|
{IParameterBlockItem is not used on its own but instead provides a base type for |
271 |
|
different parameter block items } |
272 |
|
|
284 |
|
property AsInteger: integer read getAsInteger write SetAsInteger; |
285 |
|
end; |
286 |
|
|
287 |
+ |
IParameterBlockItemWithTypeName = interface(IParameterBlockItem) |
288 |
+ |
function getParamTypeName: AnsiString; |
289 |
+ |
end; |
290 |
|
|
291 |
|
{The IStatus interface provides access to error information, if any, returned |
292 |
|
by the last API call. It can also be used to customise the error message |
301 |
|
|
302 |
|
TIBDataBaseErrorMessages = set of TIBDataBaseErrorMessage; |
303 |
|
|
304 |
+ |
TStatusCode = long; |
305 |
+ |
|
306 |
|
IStatus = interface |
307 |
|
['{34167722-af38-4831-b08a-93162d58ede3}'] |
308 |
< |
function GetIBErrorCode: Long; |
309 |
< |
function Getsqlcode: Long; |
308 |
> |
function GetIBErrorCode: TStatusCode; |
309 |
> |
function Getsqlcode: TStatusCode; |
310 |
|
function GetMessage: AnsiString; |
311 |
|
function CheckStatusVector(ErrorCodes: array of TFBStatusCode): Boolean; |
312 |
|
function GetIBDataBaseErrorMessages: TIBDataBaseErrorMessages; |
329 |
|
function GetSQLTypeName: AnsiString; |
330 |
|
function GetScale: integer; |
331 |
|
function GetSize: cardinal; |
332 |
+ |
function GetCharSetWidth: integer; |
333 |
|
function GetCharSetID: cardinal; |
334 |
|
function GetTableName: AnsiString; |
335 |
|
function GetColumnName: AnsiString; |
368 |
|
function GetAsBoolean(index: array of integer): boolean; |
369 |
|
function GetAsCurrency(index: array of integer): Currency; |
370 |
|
function GetAsInt64(index: array of integer): Int64; |
371 |
< |
function GetAsDateTime(index: array of integer): TDateTime; |
371 |
> |
function GetAsDateTime(index: array of integer): TDateTime; overload; |
372 |
> |
procedure GetAsDateTime(index: array of integer; var aDateTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID); overload; |
373 |
> |
procedure GetAsDateTime(index: array of integer; var aDateTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString); overload; |
374 |
> |
procedure GetAsTime(index: array of integer; var aTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID; OnDate: TDateTime); overload; |
375 |
> |
procedure GetAsTime(index: array of integer; var aTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString; OnDate: TDateTime); overload; |
376 |
> |
function GetAsUTCDateTime(index: array of integer): TDateTime; |
377 |
|
function GetAsDouble(index: array of integer): Double; |
378 |
|
function GetAsFloat(index: array of integer): Float; |
379 |
|
function GetAsLong(index: array of integer): Long; |
380 |
|
function GetAsShort(index: array of integer): Short; |
381 |
|
function GetAsString(index: array of integer): AnsiString; |
382 |
|
function GetAsVariant(index: array of integer): Variant; |
383 |
+ |
function GetAsBCD(index: array of integer): tBCD; |
384 |
|
procedure SetAsInteger(index: array of integer; AValue: integer); |
385 |
|
procedure SetAsBoolean(index: array of integer; AValue: boolean); |
386 |
|
procedure SetAsCurrency(index: array of integer; Value: Currency); |
387 |
|
procedure SetAsInt64(index: array of integer; Value: Int64); |
388 |
|
procedure SetAsDate(index: array of integer; Value: TDateTime); |
389 |
+ |
procedure SetAsDateTime(index: array of integer; Value: TDateTime); overload; |
390 |
+ |
procedure SetAsDateTime(index: array of integer; aValue: TDateTime; aTimeZoneID: TFBTimeZoneID); overload; |
391 |
+ |
procedure SetAsDateTime(index: array of integer; aValue: TDateTime; aTimeZone: AnsiString); overload; |
392 |
+ |
procedure SetAsTime(index: array of integer; Value: TDateTime); overload; |
393 |
+ |
procedure SetAsTime(index: array of integer; aValue: TDateTime; OnDate: TDateTime; aTimeZoneID: TFBTimeZoneID); overload; |
394 |
+ |
procedure SetAsTime(index: array of integer; aValue: TDateTime; OnDate: TDateTime; aTimeZone: AnsiString); overload; |
395 |
+ |
procedure SetAsUTCDateTime(index: array of integer; aUTCTime: TDateTime); |
396 |
|
procedure SetAsLong(index: array of integer; Value: Long); |
345 |
– |
procedure SetAsTime(index: array of integer; Value: TDateTime); |
346 |
– |
procedure SetAsDateTime(index: array of integer; Value: TDateTime); |
397 |
|
procedure SetAsDouble(index: array of integer; Value: Double); |
398 |
|
procedure SetAsFloat(index: array of integer; Value: Float); |
399 |
|
procedure SetAsShort(index: array of integer; Value: Short); |
400 |
|
procedure SetAsString(index: array of integer; Value: AnsiString); |
401 |
|
procedure SetAsVariant(index: array of integer; Value: Variant); |
402 |
+ |
procedure SetAsBcd(index: array of integer; aValue: tBCD); |
403 |
|
procedure SetBounds(dim, UpperBound, LowerBound: integer); |
404 |
|
function GetAttachment: IAttachment; |
405 |
|
function GetTransaction: ITransaction; |
472 |
|
|
473 |
|
TIBDateTimeFormats = (dfTimestamp, {SQL TIMESTAMP} |
474 |
|
dfDateTime, {SQL DATETIME} |
475 |
< |
dfTime); {SQL TIME} |
475 |
> |
dfTime, {SQL TIME} |
476 |
> |
dfTimestampTZ, {SQL_TIMESTAMP_TZ} |
477 |
> |
dfTimeTZ); {SQLTIME_TZ |
478 |
|
|
479 |
|
{ IColumnMetaData } |
480 |
|
|
492 |
|
function getScale: integer; |
493 |
|
function getCharSetID: cardinal; |
494 |
|
function getCodePage: TSystemCodePage; |
495 |
+ |
function GetCharSetWidth: integer; |
496 |
|
function getIsNullable: boolean; |
497 |
|
function GetSize: cardinal; |
498 |
|
function GetArrayMetaData: IArrayMetaData; {Valid only for Array SQL Type} |
545 |
|
function GetAsBoolean: boolean; |
546 |
|
function GetAsCurrency: Currency; |
547 |
|
function GetAsInt64: Int64; |
548 |
< |
function GetAsDateTime: TDateTime; |
548 |
> |
function GetAsDateTime: TDateTime; overload; |
549 |
> |
procedure GetAsDateTime(var aDateTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID); overload; |
550 |
> |
procedure GetAsDateTime(var aDateTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString); overload; |
551 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID; OnDate: TDateTime); overload; |
552 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString; OnDate: TDateTime); overload; |
553 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID); overload; |
554 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString); overload; |
555 |
> |
function GetAsUTCDateTime: TDateTime; |
556 |
|
function GetAsDouble: Double; |
557 |
|
function GetAsFloat: Float; |
558 |
|
function GetAsLong: Long; |
565 |
|
function GetAsBlob: IBlob; overload; |
566 |
|
function GetAsBlob(BPB: IBPB): IBlob; overload; |
567 |
|
function GetAsArray: IArray; |
568 |
+ |
function GetAsBCD: tBCD; |
569 |
|
property AsDate: TDateTime read GetAsDateTime; |
570 |
|
property AsBoolean:boolean read GetAsBoolean; |
571 |
|
property AsTime: TDateTime read GetAsDateTime; |
583 |
|
property AsVariant: Variant read GetAsVariant ; |
584 |
|
property AsBlob: IBlob read GetAsBlob; |
585 |
|
property AsArray: IArray read GetAsArray; |
586 |
+ |
property AsBCD: tBCD read GetAsBCD; |
587 |
|
property IsNull: Boolean read GetIsNull; |
588 |
|
property Value: Variant read GetAsVariant; |
589 |
|
end; |
621 |
|
end; |
622 |
|
|
623 |
|
{The ISQLParam interface is used to provide access to each parameter in a |
624 |
< |
parametised SQL Statement. It subclasses IColumnMetaData and this part of |
562 |
< |
the interface may be used to access information on the expected SQL Type, etc. |
563 |
< |
|
564 |
< |
It also subclasses ISQLData and this part of the interface may be used to access |
565 |
< |
current values for each parameter. |
566 |
< |
|
567 |
< |
Otherwise, the interface comprises the Setter Methods and properties used to |
624 |
> |
parametised SQL Statement. The interface comprises the Setter Methods and properties used to |
625 |
|
set the value of each parameter. |
626 |
|
|
627 |
|
Automatic conversion is provided to and from strings. That is GetAsString and |
628 |
|
SetAsString are safe to use for sql types other than boolean - provided automatic |
629 |
|
conversion is possible. |
630 |
+ |
|
631 |
+ |
ISQLParam is subclassed from the IParamMetaData interface. This interface provides |
632 |
+ |
access to the parameter metadata. This metadata is mutable and can change after |
633 |
+ |
a parameter is set to a given value. This is acceptable as long as the parameter |
634 |
+ |
metadata is type compatible with the underlying column metadata and hence the |
635 |
+ |
parameter value can be converted by Firebird into a value acceptable by the |
636 |
+ |
underlying column. The column metadata, which is unmutable, can be obtained |
637 |
+ |
by the ISQLParam.getColMetadata interface. When a statement is prepared, the |
638 |
+ |
parameter metadata is always initialised to the column metadata. |
639 |
|
} |
640 |
|
|
641 |
< |
ISQLParam = interface |
642 |
< |
['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}'] |
577 |
< |
function GetIndex: integer; |
641 |
> |
IParamMetaData = interface |
642 |
> |
['{4e148c4e-2d48-4991-a263-f66eca05c6aa}'] |
643 |
|
function GetSQLType: cardinal; |
644 |
|
function GetSQLTypeName: AnsiString; |
645 |
|
function getSubtype: integer; |
581 |
– |
function getName: AnsiString; |
646 |
|
function getScale: integer; |
647 |
|
function getCharSetID: cardinal; |
648 |
|
function getCodePage: TSystemCodePage; |
649 |
|
function getIsNullable: boolean; |
650 |
|
function GetSize: cardinal; |
651 |
+ |
property SQLType: cardinal read GetSQLType; |
652 |
+ |
end; |
653 |
+ |
|
654 |
+ |
ISQLParam = interface(IParamMetaData) |
655 |
+ |
['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}'] |
656 |
+ |
function getColMetadata: IParamMetaData; |
657 |
+ |
function GetIndex: integer; |
658 |
+ |
function getName: AnsiString; |
659 |
|
function GetAsBoolean: boolean; |
660 |
|
function GetAsCurrency: Currency; |
661 |
|
function GetAsInt64: Int64; |
662 |
< |
function GetAsDateTime: TDateTime; |
662 |
> |
function GetAsDateTime: TDateTime; overload; |
663 |
> |
procedure GetAsDateTime(var aDateTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID); overload; |
664 |
> |
procedure GetAsDateTime(var aDateTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString); overload; |
665 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID; OnDate: TDateTime); overload; |
666 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString; OnDate: TDateTime); overload; |
667 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezoneID: TFBTimeZoneID); overload; |
668 |
> |
procedure GetAsTime(var aTime: TDateTime; var dstOffset: smallint; var aTimezone: AnsiString); overload; |
669 |
> |
function GetAsUTCDateTime: TDateTime; |
670 |
|
function GetAsDouble: Double; |
671 |
|
function GetAsFloat: Float; |
672 |
|
function GetAsLong: Long; |
678 |
|
function GetAsVariant: Variant; |
679 |
|
function GetAsBlob: IBlob; |
680 |
|
function GetAsArray: IArray; |
681 |
+ |
function GetAsBCD: tBCD; |
682 |
+ |
function GetStatement: IStatement; |
683 |
+ |
function GetTransaction: ITransaction; |
684 |
|
procedure Clear; |
685 |
|
function GetModified: boolean; |
686 |
|
procedure SetAsBoolean(AValue: boolean); |
688 |
|
procedure SetAsInt64(aValue: Int64); |
689 |
|
procedure SetAsDate(aValue: TDateTime); |
690 |
|
procedure SetAsLong(aValue: Long); |
691 |
< |
procedure SetAsTime(aValue: TDateTime); |
692 |
< |
procedure SetAsDateTime(aValue: TDateTime); |
691 |
> |
procedure SetAsTime(aValue: TDateTime); overload; |
692 |
> |
procedure SetAsTime(aValue: TDateTime; OnDate: TDateTime; aTimeZoneID: TFBTimeZoneID); overload; |
693 |
> |
procedure SetAsTime(aValue: TDateTime; OnDate: TDateTime; aTimeZone: AnsiString); overload; |
694 |
> |
procedure SetAsTime(aValue: TDateTime; aTimeZoneID: TFBTimeZoneID); overload; |
695 |
> |
procedure SetAsTime(aValue: TDateTime; aTimeZone: AnsiString); overload; |
696 |
> |
procedure SetAsDateTime(aValue: TDateTime); overload; |
697 |
> |
procedure SetAsDateTime(aValue: TDateTime; aTimeZoneID: TFBTimeZoneID); overload; |
698 |
> |
procedure SetAsDateTime(aValue: TDateTime; aTimeZone: AnsiString); overload; |
699 |
> |
procedure SetAsUTCDateTime(aUTCTime: TDateTime); |
700 |
|
procedure SetAsDouble(aValue: Double); |
701 |
|
procedure SetAsFloat(aValue: Float); |
702 |
|
procedure SetAsPointer(aValue: Pointer); |
708 |
|
procedure SetAsArray(anArray: IArray); |
709 |
|
procedure SetAsQuad(aValue: TISC_QUAD); |
710 |
|
procedure SetCharSetID(aValue: cardinal); |
711 |
+ |
procedure SetAsBcd(aValue: tBCD); |
712 |
|
property AsDate: TDateTime read GetAsDateTime write SetAsDate; |
713 |
|
property AsBoolean:boolean read GetAsBoolean write SetAsBoolean; |
714 |
|
property AsTime: TDateTime read GetAsDateTime write SetAsTime; |
725 |
|
property AsVariant: Variant read GetAsVariant write SetAsVariant; |
726 |
|
property AsBlob: IBlob read GetAsBlob write SetAsBlob; |
727 |
|
property AsArray: IArray read GetAsArray write SetAsArray; |
728 |
+ |
property AsBCD: tBCD read GetAsBCD write SetAsBCD; |
729 |
|
property AsQuad: TISC_QUAD read GetAsQuad write SetAsQuad; |
730 |
|
property Value: Variant read GetAsVariant write SetAsVariant; |
731 |
|
property IsNull: Boolean read GetIsNull write SetIsNull; |
732 |
|
property IsNullable: Boolean read GetIsNullable; |
733 |
|
property Modified: Boolean read getModified; |
734 |
|
property Name: AnsiString read GetName; |
644 |
– |
property SQLType: cardinal read GetSQLType; |
735 |
|
end; |
736 |
|
|
737 |
|
{ |
758 |
|
|
759 |
|
TPerfCounters = array[TPerfStats] of Int64; |
760 |
|
|
761 |
+ |
{Batch Query Execution Support} |
762 |
+ |
|
763 |
+ |
TBatchCompletionState = (bcExecuteFailed, bcSuccessNoInfo, bcNoMoreErrors); |
764 |
+ |
|
765 |
+ |
IBatchCompletion = interface |
766 |
+ |
['{9bc3d49d-16d9-4606-94e5-ee987103ad92}'] |
767 |
+ |
function getTotalProcessed: cardinal; |
768 |
+ |
function getState(updateNo: cardinal): TBatchCompletionState; |
769 |
+ |
function getStatusMessage(updateNo: cardinal): AnsiString; |
770 |
+ |
function getUpdated: integer; |
771 |
+ |
function getErrorStatus(var RowNo: integer; var status: IStatus): boolean; |
772 |
+ |
end; |
773 |
+ |
|
774 |
|
{The IStatement interface provides access to an SQL Statement once it has been |
775 |
|
initially prepared. The interface is returned from the IAttachment interface. |
776 |
|
} |
782 |
|
function GetPlan: AnsiString; |
783 |
|
function GetRowsAffected(var SelectCount, InsertCount, UpdateCount, DeleteCount: integer): boolean; |
784 |
|
function GetSQLStatementType: TIBSQLStatementTypes; |
785 |
+ |
function GetSQLStatementTypeName: AnsiString; |
786 |
|
function GetSQLText: AnsiString; |
787 |
|
function GetProcessedSQLText: AnsiString; |
788 |
|
function GetSQLDialect: integer; |
789 |
|
function IsPrepared: boolean; |
790 |
+ |
function HasBatchMode: boolean; |
791 |
+ |
function IsInBatchMode: boolean; |
792 |
|
procedure Prepare(aTransaction: ITransaction=nil); |
793 |
|
function Execute(aTransaction: ITransaction=nil): IResults; |
794 |
|
function OpenCursor(aTransaction: ITransaction=nil): IResultSet; |
797 |
|
procedure SetRetainInterfaces(aValue: boolean); |
798 |
|
procedure EnableStatistics(aValue: boolean); |
799 |
|
function GetPerfStatistics(var stats: TPerfCounters): boolean; |
800 |
+ |
{IBatch interface support} |
801 |
+ |
procedure AddToBatch; |
802 |
+ |
function ExecuteBatch(aTransaction: ITransaction=nil): IBatchCompletion; |
803 |
+ |
procedure CancelBatch; |
804 |
+ |
function GetBatchCompletion: IBatchCompletion; |
805 |
+ |
function GetBatchRowLimit: integer; |
806 |
+ |
procedure SetBatchRowLimit(aLimit: integer); |
807 |
+ |
{Stale Reference Check} |
808 |
+ |
procedure SetStaleReferenceChecks(Enable:boolean); {default true} |
809 |
+ |
function GetStaleReferenceChecks: boolean; |
810 |
+ |
|
811 |
|
property MetaData: IMetaData read GetMetaData; |
812 |
|
property SQLParams: ISQLParams read GetSQLParams; |
813 |
|
property SQLStatementType: TIBSQLStatementTypes read GetSQLStatementType; |
824 |
|
found in the Interbase 6.0 API Guide. |
825 |
|
} |
826 |
|
|
827 |
< |
ITPBItem = interface(IParameterBlockItem) |
827 |
> |
ITPBItem = interface(IParameterBlockItemWithTypeName) |
828 |
|
['{544c1f2b-7c12-4a87-a4a5-face7ea72671}'] |
829 |
+ |
function getParamTypeName: AnsiString; |
830 |
|
end; |
831 |
|
|
832 |
< |
ITPB = interface(IParameterBlock<ITPBItem>) |
832 |
> |
ITPB = interface(IParameterBlockWithTypeNames<ITPBItem>) |
833 |
|
['{7369b0ff-defe-437b-81fe-19b211d42d25}'] |
834 |
|
end; |
835 |
|
|
895 |
|
function GetAttachment: IAttachment; |
896 |
|
end; |
897 |
|
|
898 |
+ |
TTZTextOptions = (tzOffset, {Time Zone Rendered as an offset to GMT} |
899 |
+ |
tzGMT, {No Time Zone. Time part is always rendered in GMT} |
900 |
+ |
tzOriginalID); {Time Zone shown as originally entered} |
901 |
+ |
|
902 |
+ |
{The ITimeZoneServices interface provides access to the time zone database |
903 |
+ |
used for the attachment. It may be used in support of TIMESTAMP WITH TIME ZONE |
904 |
+ |
and TIME WITH TIME ZONE data types.} |
905 |
+ |
|
906 |
+ |
ITimeZoneServices = interface |
907 |
+ |
['{163821f5-ebef-42b9-ac60-8ac4b5c09954}'] |
908 |
+ |
{utility functions} |
909 |
+ |
function TimeZoneID2TimeZoneName(aTimeZoneID: TFBTimeZoneID): AnsiString; |
910 |
+ |
function TimeZoneName2TimeZoneID(aTimeZone: AnsiString): TFBTimeZoneID; |
911 |
+ |
function LocalTimeToGMT(aLocalTime: TDateTime; aTimeZone: AnsiString): TDateTime; overload; |
912 |
+ |
function LocalTimeToGMT(aLocalTime: TDateTime; aTimeZoneID: TFBTimeZoneID): TDateTime; overload; |
913 |
+ |
function GMTToLocalTime(aGMTTime: TDateTime; aTimeZone: AnsiString): TDateTime; overload; |
914 |
+ |
function GMTToLocalTime(aGMTTime: TDateTime; aTimeZoneID: TFBTimeZoneID): TDateTime; overload; |
915 |
+ |
function GetEffectiveOffsetMins(aLocalTime: TDateTime; aTimeZone: AnsiString): integer; overload; |
916 |
+ |
function GetEffectiveOffsetMins(aLocalTime: TDateTime; aTimeZoneID: TFBTimeZoneID): integer; overload; |
917 |
+ |
|
918 |
+ |
{Time Zone DB Information} |
919 |
+ |
function UsingRemoteTZDB: boolean; |
920 |
+ |
procedure SetUseLocalTZDB(useLocalTZDB: boolean); |
921 |
+ |
function GetLocalTimeZoneName: AnsiString; |
922 |
+ |
function GetLocalTimeZoneID: TFBTimeZoneID; |
923 |
+ |
procedure GetTimeZoneInfo(aTimeZone: AnsiString; OnDate: TDateTime; |
924 |
+ |
var ZoneOffset, DSTOffset, EffectiveOffset: integer); |
925 |
+ |
{Configurable Options} |
926 |
+ |
function GetTimeTZDate: TDateTime; |
927 |
+ |
procedure SetTimeTZDate(aDate: TDateTime); |
928 |
+ |
function GetTZTextOption: TTZTextOptions; |
929 |
+ |
procedure SetTZTextOption(aOptionValue: TTZTextOptions); |
930 |
+ |
end; |
931 |
+ |
|
932 |
|
{The IDBInformation Interface. |
933 |
|
|
934 |
|
An IDBInformation interface is returned by the IAttachment GetDBInformation |
957 |
|
function getSize: integer; |
958 |
|
procedure getRawBytes(var Buffer); |
959 |
|
function getAsString: AnsiString; |
960 |
< |
function getAsInteger: integer; |
960 |
> |
function getAsInteger: int64; |
961 |
|
procedure DecodeIDCluster(var ConnectionType: integer; var DBFileName, DBSiteName: AnsiString); |
962 |
|
function getAsBytes: TByteArray; |
963 |
|
function getAsDateTime: TDateTime; |
969 |
|
function GetCount: integer; |
970 |
|
function GetItem(index: integer): IDBInfoItem; |
971 |
|
function Find(ItemType: byte): IDBInfoItem; |
972 |
< |
property AsInteger: integer read getAsInteger; |
972 |
> |
property AsInteger: int64 read getAsInteger; |
973 |
|
property AsString: AnsiString read GetAsString; |
974 |
|
property Count: integer read GetCount; |
975 |
|
property Items[index: integer]: IDBInfoItem read getItem; default; |
1012 |
|
found in the Interbase 6.0 API Guide. |
1013 |
|
} |
1014 |
|
|
1015 |
< |
IDPBItem = interface(IParameterBlockItem) |
1015 |
> |
IDPBItem = interface(IParameterBlockItemWithTypeName) |
1016 |
|
['{123d4ad0-087a-4cd1-a344-1b3d03b30673}'] |
1017 |
|
end; |
1018 |
|
|
1019 |
< |
IDPB = interface(IParameterBlock<IDPBItem>) |
1020 |
< |
['{e676067b-1cf4-4eba-9256-9724f57e0d16}'] |
1021 |
< |
end; |
1019 |
> |
IDPB = interface(IParameterBlockWithTypeNames<IDPBItem>) |
1020 |
> |
['{e676067b-1cf4-4eba-9256-9724f57e0d16}'] |
1021 |
> |
end; |
1022 |
|
|
1023 |
|
{The IAttachment interface provides access to a Database Connection. It may be |
1024 |
|
used to: |
1102 |
|
function CreateBlob(transaction: ITransaction; SubType: integer; CharSetID: cardinal=0; BPB: IBPB=nil): IBlob; overload; |
1103 |
|
function OpenBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload; |
1104 |
|
function OpenBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload; |
1105 |
+ |
function GetInlineBlobLimit: integer; |
1106 |
+ |
procedure SetInlineBlobLimit(limit: integer); |
1107 |
|
|
1108 |
|
{Array - may use to open existing arrays. However, ISQLData.AsArray is preferred} |
1109 |
|
|
1130 |
|
function GetODSMinorVersion: integer; |
1131 |
|
procedure getFBVersion(version: TStrings); |
1132 |
|
function HasActivity: boolean; |
1133 |
+ |
function HasDecFloatSupport: boolean; |
1134 |
+ |
function HasBatchMode: boolean; |
1135 |
|
|
1136 |
|
{Character Sets} |
1137 |
|
function HasDefaultCharSet: boolean; |
1143 |
|
function CharSetWidth(CharSetID: integer; var Width: integer): boolean; |
1144 |
|
procedure RegisterCharSet(CharSetName: AnsiString; CodePage: TSystemCodePage; |
1145 |
|
AllowReverseLookup:boolean; out CharSetID: integer); |
1146 |
< |
end; |
1146 |
> |
|
1147 |
> |
{Time Zone Database} |
1148 |
> |
function GetTimeZoneServices: ITimeZoneServices; |
1149 |
> |
function HasTimeZoneSupport: boolean; |
1150 |
> |
end; |
1151 |
|
|
1152 |
|
TProtocolAll = (TCP, SPX, NamedPipe, Local, inet, inet4, inet6, wnet, xnet, unknownProtocol); |
1153 |
|
TProtocol = TCP..xnet; |
1164 |
|
|
1165 |
|
} |
1166 |
|
|
1167 |
< |
ISPBItem = interface(IParameterBlockItem) |
1167 |
> |
ISPBItem = interface(IParameterBlockItemWithTypeName) |
1168 |
|
['{5d08ae2b-4519-41bd-8b40-97cd451c3f6a}'] |
1169 |
|
end; |
1170 |
|
|
1171 |
< |
ISPB = interface(IParameterBlock<ISPBItem>) |
1171 |
> |
ISPB = interface(IParameterBlockWithTypeNames<ISPBItem>) |
1172 |
|
['{2c5836fd-41ed-4426-9b7d-5af580ec2659}'] |
1173 |
|
end; |
1174 |
|
|
1228 |
|
function getSize: integer; |
1229 |
|
procedure getRawBytes(var Buffer); |
1230 |
|
function getAsString: AnsiString; |
1231 |
< |
function getAsInteger: integer; |
1231 |
> |
function getAsInteger: int64; |
1232 |
|
function getAsByte: byte; |
1233 |
|
function CopyTo(stream: TStream; count: integer): integer; |
1234 |
|
property AsString: AnsiString read getAsString; |
1235 |
< |
property AsInteger: integer read getAsInteger; |
1235 |
> |
property AsInteger: int64 read getAsInteger; |
1236 |
|
property AsByte: byte read getAsByte; |
1237 |
|
end; |
1238 |
|
|
1302 |
|
The interface is returned by the FirebirdAPI function. |
1303 |
|
} |
1304 |
|
|
1305 |
+ |
{ IFirebirdAPI } |
1306 |
+ |
|
1307 |
|
IFirebirdAPI = interface |
1308 |
|
['{edeee691-c8d3-4dcf-a780-cd7e432821d5}'] |
1309 |
|
{Database connections} |
1332 |
|
function GetImplementationVersion: AnsiString; |
1333 |
|
function GetClientMajor: integer; |
1334 |
|
function GetClientMinor: integer; |
1335 |
+ |
function HasDecFloatSupport: boolean; |
1336 |
+ |
function HasLocalTZDB: boolean; |
1337 |
+ |
function HasTimeZoneSupport: boolean; |
1338 |
+ |
function HasExtendedTZSupport: boolean; |
1339 |
|
|
1340 |
|
{Firebird 3 API} |
1341 |
|
function HasMasterIntf: boolean; |
1342 |
< |
function GetIMaster: TObject; |
1342 |
> |
function GetIMaster: TObject; deprecated 'Use FirebirdAPI.QueryInterface and FBClientLib.pas IFBIMasterProvider instead'; |
1343 |
|
function GetFBLibrary: IFirebirdLibrary; |
1344 |
|
end; |
1345 |
|
|
1375 |
|
{IB Client Exceptions} |
1376 |
|
EIBClientError = class(EIBError); |
1377 |
|
|
1378 |
+ |
{Used to explicitly report a Batch Buffer overflow} |
1379 |
+ |
EIBBatchBufferOverflow = class(EIBError); |
1380 |
+ |
|
1381 |
|
{The Firebird API function is used to access the IFirebirdAPI interface. |
1382 |
|
|
1383 |
|
It will load the Firebird Client Library if this is not already loaded and |
1387 |
|
function FirebirdAPI: IFirebirdAPI; |
1388 |
|
|
1389 |
|
{IBX support functions. Probably best ignored i.e. always used the FirebirdAPI |
1390 |
< |
functino to load the library and check if it's loaded.} |
1390 |
> |
function to load the library and check if it's loaded.} |
1391 |
|
|
1392 |
|
function TryIBLoad: Boolean; |
1393 |
|
procedure CheckIBLoaded; |
1398 |
|
|
1399 |
|
function LoadFBLibrary(aLibPathName: string): IFirebirdLibrary; |
1400 |
|
|
1401 |
+ |
|
1402 |
|
implementation |
1403 |
|
|
1404 |
|
uses FBClientAPI |