60 |
|
{ } |
61 |
|
{************************************************************************} |
62 |
|
unit IB; |
63 |
+ |
{$IFDEF MSWINDOWS} |
64 |
+ |
{$DEFINE WINDOWS} |
65 |
+ |
{$ENDIF} |
66 |
|
|
67 |
|
{$IFDEF FPC} |
68 |
< |
{$mode objfpc}{$H+} |
68 |
> |
{$mode delphi} |
69 |
|
{$codepage UTF8} |
70 |
|
{$interfaces COM} |
71 |
< |
{$IF FPC_FULLVERSION < 30000 } |
71 |
> |
{$IF defined(FPC) and (FPC_FULLVERSION < 30000) } |
72 |
|
{$ERROR FPC Version 3.0.0 or later is required} |
73 |
< |
{$ENDIF} |
73 |
> |
{$IFEND} |
74 |
|
{$ENDIF} |
75 |
|
|
76 |
|
{$DEFINE USEFIREBIRD3API} |
106 |
|
|
107 |
|
5. Straightforward progammatic access to the Firebird API from Pascal programs. |
108 |
|
|
109 |
+ |
6. FPC and Delphi Support. |
110 |
+ |
|
111 |
|
String Types |
112 |
|
============ |
113 |
|
|
128 |
|
{Interface version information} |
129 |
|
FBIntf_Major = 1; |
130 |
|
FBIntf_Minor = 0; |
131 |
< |
FBIntf_Release = 1; |
132 |
< |
FBIntf_Version = '1.0.1'; |
131 |
> |
FBIntf_Release = 2; |
132 |
> |
FBIntf_Version = '1.0.2'; |
133 |
|
|
134 |
|
{These include files are converted from the 'C' originals in the Firebird API |
135 |
|
and define the various constants used by the API} |
136 |
|
|
137 |
< |
{$I consts_pub.inc} |
138 |
< |
{$I inf_pub.inc} |
139 |
< |
{$I configkeys.inc} |
137 |
> |
{$I 'include/consts_pub.inc'} |
138 |
> |
{$I 'include/inf_pub.inc'} |
139 |
> |
{$I 'include/configkeys.inc'} |
140 |
|
|
141 |
|
{The following constants define the values return by calls to the GetSQLType |
142 |
|
methods provided by several of the interfaces defined below.} |
172 |
|
PGDS__QUAD = ^TGDS__QUAD; |
173 |
|
PISC_QUAD = ^TISC_QUAD; |
174 |
|
|
175 |
+ |
{$IFNDEF FPC} |
176 |
+ |
{Delphi only seems to define CP_UTF8 and CP_UTF16} |
177 |
+ |
const |
178 |
+ |
CP_ACP = 0; // default to ANSI code page |
179 |
+ |
CP_OEMCP = 1; // default to OEM (console) code page |
180 |
+ |
CP_UTF16BE = 1201; // unicodeFFFE |
181 |
+ |
CP_UTF7 = 65000; // utf-7 |
182 |
+ |
CP_ASCII = 20127; // us-ascii |
183 |
+ |
CP_NONE = $FFFF; // rawbytestring encoding |
184 |
+ |
|
185 |
+ |
{$ENDIF} |
186 |
+ |
|
187 |
+ |
type |
188 |
+ |
{$IF not declared(TSystemCodePage)} |
189 |
+ |
TSystemCodePage = word; {not defined in Delphi} |
190 |
+ |
{$IFEND} |
191 |
+ |
|
192 |
|
TIBSQLStatementTypes = |
193 |
|
(SQLUnknown, SQLSelect, SQLInsert, |
194 |
|
SQLUpdate, SQLDelete, SQLDDL, |
203 |
|
IAttachment = interface; |
204 |
|
ITransaction = interface; |
205 |
|
|
206 |
< |
{The IParameterBlock generic interface provides the template for all parameter |
206 |
> |
{The IParameterBlock interface provides the template for all parameter |
207 |
|
block interfaces} |
208 |
|
|
209 |
< |
generic IParameterBlock<_IItem> = interface |
209 |
> |
IParameterBlock<_IItem> = interface |
210 |
|
function getCount: integer; |
211 |
|
function Add(ParamType: byte): _IItem; |
212 |
|
function getItems(index: integer): _IItem; |
220 |
|
different parameter block items } |
221 |
|
|
222 |
|
IParameterBlockItem = interface |
223 |
+ |
['{53b23f7b-abda-46a5-9aa5-07bd5e723266}'] |
224 |
|
function getParamType: byte; |
225 |
|
function getAsInteger: integer; |
226 |
< |
function getAsString: string; |
226 |
> |
function getAsString: AnsiString; |
227 |
|
function getAsByte: byte; |
228 |
< |
procedure setAsString(aValue: string); |
228 |
> |
procedure setAsString(aValue: AnsiString); |
229 |
|
procedure setAsByte(aValue: byte); |
230 |
|
procedure SetAsInteger(aValue: integer); |
231 |
< |
property AsString: string read getAsString write setAsString; |
231 |
> |
property AsString: AnsiString read getAsString write setAsString; |
232 |
|
property AsByte: byte read getAsByte write setAsByte; |
233 |
|
property AsInteger: integer read getAsInteger write SetAsInteger; |
234 |
|
end; |
242 |
|
} |
243 |
|
|
244 |
|
IStatus = interface |
245 |
+ |
['{34167722-af38-4831-b08a-93162d58ede3}'] |
246 |
|
function GetIBErrorCode: Long; |
247 |
|
function Getsqlcode: Long; |
248 |
< |
function GetMessage: string; |
248 |
> |
function GetMessage: AnsiString; |
249 |
|
function CheckStatusVector(ErrorCodes: array of TFBStatusCode): Boolean; |
250 |
|
function GetIBDataBaseErrorMessages: TIBDataBaseErrorMessages; |
251 |
|
procedure SetIBDataBaseErrorMessages(Value: TIBDataBaseErrorMessages); |
262 |
|
TArrayBounds = array of TArrayBound; |
263 |
|
|
264 |
|
IArrayMetaData = interface |
265 |
+ |
['{7dd0aea4-59af-4c2a-b958-565d5025c489}'] |
266 |
|
function GetSQLType: cardinal; |
267 |
< |
function GetSQLTypeName: string; |
267 |
> |
function GetSQLTypeName: AnsiString; |
268 |
|
function GetScale: integer; |
269 |
|
function GetSize: cardinal; |
270 |
|
function GetCharSetID: cardinal; |
271 |
< |
function GetTableName: string; |
272 |
< |
function GetColumnName: string; |
271 |
> |
function GetTableName: AnsiString; |
272 |
> |
function GetColumnName: AnsiString; |
273 |
|
function GetDimensions: integer; |
274 |
|
function GetBounds: TArrayBounds; |
275 |
|
end; |
294 |
|
TArrayEventHandler = procedure(Sender: IArray; Reason: TArrayEventReason) of object; |
295 |
|
|
296 |
|
IArray = interface(IArrayMetaData) |
297 |
+ |
['{631c6bb1-fb49-44fb-a64a-c49859632b88}'] |
298 |
|
function GetArrayID: TISC_QUAD; |
299 |
|
procedure Clear; |
300 |
|
function IsEmpty: boolean; |
310 |
|
function GetAsFloat(index: array of integer): Float; |
311 |
|
function GetAsLong(index: array of integer): Long; |
312 |
|
function GetAsShort(index: array of integer): Short; |
313 |
< |
function GetAsString(index: array of integer): String; |
313 |
> |
function GetAsString(index: array of integer): AnsiString; |
314 |
|
function GetAsVariant(index: array of integer): Variant; |
315 |
|
procedure SetAsInteger(index: array of integer; AValue: integer); |
316 |
|
procedure SetAsBoolean(index: array of integer; AValue: boolean); |
323 |
|
procedure SetAsDouble(index: array of integer; Value: Double); |
324 |
|
procedure SetAsFloat(index: array of integer; Value: Float); |
325 |
|
procedure SetAsShort(index: array of integer; Value: Short); |
326 |
< |
procedure SetAsString(index: array of integer; Value: String); |
326 |
> |
procedure SetAsString(index: array of integer; Value: AnsiString); |
327 |
|
procedure SetAsVariant(index: array of integer; Value: Variant); |
328 |
|
procedure SetBounds(dim, UpperBound, LowerBound: integer); |
329 |
|
function GetAttachment: IAttachment; |
337 |
|
} |
338 |
|
|
339 |
|
IBlobMetaData = interface |
340 |
+ |
['{575f3c61-bb33-46a5-8975-bb7d1b6e37cc}'] |
341 |
|
function GetSubType: integer; |
342 |
|
function GetCharSetID: cardinal; |
343 |
|
function GetCodePage: TSystemCodePage; |
344 |
|
function GetSegmentSize: cardinal; |
345 |
< |
function GetRelationName: string; |
346 |
< |
function GetColumnName: string; |
345 |
> |
function GetRelationName: AnsiString; |
346 |
> |
function GetColumnName: AnsiString; |
347 |
|
end; |
348 |
|
|
349 |
|
{The Blob Parameter block is used to select a Blob Filter} |
350 |
|
|
351 |
< |
IBPBItem = interface (IParameterBlockItem) end; |
351 |
> |
IBPBItem = interface (IParameterBlockItem) |
352 |
> |
['{660822a5-3114-4c16-b6cb-c1a7b2aba70d}'] |
353 |
> |
end; |
354 |
|
|
355 |
< |
IBPB = specialize IParameterBlock<IBPBItem>; |
355 |
> |
IBPB = interface(IParameterBlock<IBPBItem>) |
356 |
> |
['{e0cb9eb5-17f7-4416-b7d1-3cddd1dfca76}'] |
357 |
> |
end; |
358 |
|
|
359 |
|
{ The Blob Interface provides access to a blob data item. |
360 |
|
|
368 |
|
TBlobType = (btSegmented,btStream); |
369 |
|
|
370 |
|
IBlob = interface(IBlobMetaData) |
371 |
+ |
['{3090a145-7780-442b-b15b-efd4568b8611}'] |
372 |
|
function GetBPB: IBPB; |
373 |
|
procedure Cancel; |
374 |
|
procedure Close; |
379 |
|
TotalSize: Int64; var BlobType: TBlobType); |
380 |
|
function Read(var Buffer; Count: Longint): Longint; |
381 |
|
function Write(const Buffer; Count: Longint): Longint; |
382 |
< |
function LoadFromFile(Filename: string): IBlob; |
382 |
> |
function LoadFromFile(Filename: AnsiString): IBlob; |
383 |
|
function LoadFromStream(S: TStream) : IBlob; |
384 |
< |
function SaveToFile(Filename: string): IBlob; |
384 |
> |
function SaveToFile(Filename: AnsiString): IBlob; |
385 |
|
function SaveToStream(S: TStream): IBlob; |
386 |
|
function GetAsString: rawbytestring; |
387 |
|
procedure SetAsString(aValue: rawbytestring); |
398 |
|
{ IColumnMetaData } |
399 |
|
|
400 |
|
IColumnMetaData = interface |
401 |
+ |
['{c222e6c3-53c1-469f-9e05-0a5c3ef232d8}'] |
402 |
|
function GetIndex: integer; |
403 |
|
function GetSQLType: cardinal; |
404 |
< |
function GetSQLTypeName: string; |
404 |
> |
function GetSQLTypeName: AnsiString; |
405 |
|
function getSubtype: integer; |
406 |
< |
function getRelationName: string; |
407 |
< |
function getOwnerName: string; |
408 |
< |
function getSQLName: string; {Name of the column} |
409 |
< |
function getAliasName: string; {Alias Name of column or Column Name if no alias} |
410 |
< |
function getName: string; {Disambiguated uppercase Field Name} |
406 |
> |
function getRelationName: AnsiString; |
407 |
> |
function getOwnerName: AnsiString; |
408 |
> |
function getSQLName: AnsiString; {Name of the column} |
409 |
> |
function getAliasName: AnsiString; {Alias Name of column or Column Name if no alias} |
410 |
> |
function getName: AnsiString; {Disambiguated uppercase Field Name} |
411 |
|
function getScale: integer; |
412 |
|
function getCharSetID: cardinal; |
413 |
|
function getCodePage: TSystemCodePage; |
415 |
|
function GetSize: cardinal; |
416 |
|
function GetArrayMetaData: IArrayMetaData; {Valid only for Array SQL Type} |
417 |
|
function GetBlobMetaData: IBlobMetaData; {Valid only for Blob SQL Type} |
418 |
< |
property Name: string read GetName; |
418 |
> |
property Name: AnsiString read GetName; |
419 |
|
property Size: cardinal read GetSize; |
420 |
|
property SQLType: cardinal read GetSQLType; |
421 |
|
property Scale: integer read getScale; |
431 |
|
{ IMetaData } |
432 |
|
|
433 |
|
IMetaData = interface |
434 |
+ |
['{4dafdbb6-0d36-4f1f-9c95-8b132804b965}'] |
435 |
|
function getCount: integer; |
436 |
|
function getColumnMetaData(index: integer): IColumnMetaData; |
437 |
< |
function GetUniqueRelationName: string; {Non empty if all columns come from the same table} |
438 |
< |
function ByName(Idx: String): IColumnMetaData; |
437 |
> |
function GetUniqueRelationName: AnsiString; {Non empty if all columns come from the same table} |
438 |
> |
function ByName(Idx: AnsiString): IColumnMetaData; |
439 |
|
property ColMetaData[index: integer]: IColumnMetaData read getColumnMetaData; default; |
440 |
|
property Count: integer read getCount; |
441 |
|
end; |
455 |
|
|
456 |
|
|
457 |
|
ISQLData = interface(IColumnMetaData) |
458 |
+ |
['{3f493e31-7e3f-4606-a07c-b210b9e3619d}'] |
459 |
|
function GetAsBoolean: boolean; |
460 |
|
function GetAsCurrency: Currency; |
461 |
|
function GetAsInt64: Int64; |
466 |
|
function GetAsPointer: Pointer; |
467 |
|
function GetAsQuad: TISC_QUAD; |
468 |
|
function GetAsShort: short; |
469 |
< |
function GetAsString: String; |
469 |
> |
function GetAsString: AnsiString; |
470 |
|
function GetIsNull: Boolean; |
471 |
|
function GetAsVariant: Variant; |
472 |
|
function GetAsBlob: IBlob; overload; |
485 |
|
property AsPointer: Pointer read GetAsPointer; |
486 |
|
property AsQuad: TISC_QUAD read GetAsQuad; |
487 |
|
property AsShort: short read GetAsShort; |
488 |
< |
property AsString: String read GetAsString; |
488 |
> |
property AsString: AnsiString read GetAsString; |
489 |
|
property AsVariant: Variant read GetAsVariant ; |
490 |
|
property AsBlob: IBlob read GetAsBlob; |
491 |
|
property AsArray: IArray read GetAsArray; |
500 |
|
} |
501 |
|
|
502 |
|
IResults = interface |
503 |
+ |
['{e836b2bb-93d1-4bbf-a8eb-7ce535de3bb5}'] |
504 |
|
function getCount: integer; |
505 |
|
function GetTransaction: ITransaction; |
506 |
< |
function ByName(Idx: String): ISQLData; |
506 |
> |
function ByName(Idx: AnsiString): ISQLData; |
507 |
|
function getSQLData(index: integer): ISQLData; |
508 |
< |
procedure GetData(index: integer; var IsNull:boolean; var len: short; var data: PChar); |
508 |
> |
procedure GetData(index: integer; var IsNull:boolean; var len: short; var data: PByte); |
509 |
|
procedure SetRetainInterfaces(aValue: boolean); |
510 |
|
property Data[index: integer]: ISQLData read getSQLData; default; |
511 |
|
property Count: integer read getCount; |
517 |
|
in turn, used to access the data returned by each field of the current row. |
518 |
|
} |
519 |
|
IResultSet = interface(IResults) |
520 |
+ |
['{0ae4979b-7857-4e8c-8918-ec6f155b51a0}'] |
521 |
|
function FetchNext: boolean; |
522 |
< |
function GetCursorName: string; |
522 |
> |
function GetCursorName: AnsiString; |
523 |
|
function IsEof: boolean; |
524 |
|
procedure Close; |
525 |
|
end; |
540 |
|
} |
541 |
|
|
542 |
|
ISQLParam = interface |
543 |
+ |
['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}'] |
544 |
|
function GetIndex: integer; |
545 |
|
function GetSQLType: cardinal; |
546 |
< |
function GetSQLTypeName: string; |
546 |
> |
function GetSQLTypeName: AnsiString; |
547 |
|
function getSubtype: integer; |
548 |
< |
function getName: string; |
548 |
> |
function getName: AnsiString; |
549 |
|
function getScale: integer; |
550 |
|
function getCharSetID: cardinal; |
551 |
|
function getCodePage: TSystemCodePage; |
561 |
|
function GetAsPointer: Pointer; |
562 |
|
function GetAsQuad: TISC_QUAD; |
563 |
|
function GetAsShort: short; |
564 |
< |
function GetAsString: String; |
564 |
> |
function GetAsString: AnsiString; |
565 |
|
function GetIsNull: boolean; |
566 |
|
function GetAsVariant: Variant; |
567 |
|
function GetAsBlob: IBlob; |
579 |
|
procedure SetAsFloat(aValue: Float); |
580 |
|
procedure SetAsPointer(aValue: Pointer); |
581 |
|
procedure SetAsShort(aValue: Short); |
582 |
< |
procedure SetAsString(aValue: String); |
582 |
> |
procedure SetAsString(aValue: AnsiString); |
583 |
|
procedure SetAsVariant(aValue: Variant); |
584 |
|
procedure SetIsNull(aValue: Boolean); |
585 |
|
procedure SetAsBlob(aValue: IBlob); |
598 |
|
property AsLong: Long read GetAsLong write SetAsLong; |
599 |
|
property AsPointer: Pointer read GetAsPointer write SetAsPointer; |
600 |
|
property AsShort: Short read GetAsShort write SetAsShort; |
601 |
< |
property AsString: String read GetAsString write SetAsString; |
601 |
> |
property AsString: AnsiString read GetAsString write SetAsString; |
602 |
|
property AsVariant: Variant read GetAsVariant write SetAsVariant; |
603 |
|
property AsBlob: IBlob read GetAsBlob write SetAsBlob; |
604 |
|
property AsArray: IArray read GetAsArray write SetAsArray; |
607 |
|
property IsNull: Boolean read GetIsNull write SetIsNull; |
608 |
|
property IsNullable: Boolean read GetIsNullable; |
609 |
|
property Modified: Boolean read getModified; |
610 |
< |
property Name: string read GetName; |
610 |
> |
property Name: AnsiString read GetName; |
611 |
|
property SQLType: cardinal read GetSQLType; |
612 |
|
end; |
613 |
|
|
617 |
|
} |
618 |
|
|
619 |
|
ISQLParams = interface |
620 |
+ |
['{c6d95ac7-b2b7-461b-b890-afef0acbb077}'] |
621 |
|
function getCount: integer; |
622 |
|
function getSQLParam(index: integer): ISQLParam; |
623 |
< |
function ByName(Idx: String): ISQLParam ; |
623 |
> |
function ByName(Idx: AnsiString): ISQLParam ; |
624 |
|
function GetModified: Boolean; |
625 |
|
property Modified: Boolean read GetModified; |
626 |
|
property Params[index: integer]: ISQLParam read getSQLParam; default; |
632 |
|
psRealTime, psUserTime, psBuffers, |
633 |
|
psReads, psWrites, psFetches,psDeltaMemory); |
634 |
|
|
635 |
< |
TPerfCounters = array[TPerfStats] of Int64; |
635 |
> |
TPerfCounters = array[TPerfStats] of comp; |
636 |
|
|
637 |
|
{The IStatement interface provides access to an SQL Statement once it has been |
638 |
|
initially prepared. The interface is returned from the IAttachment interface. |
639 |
|
} |
640 |
|
|
641 |
|
IStatement = interface |
642 |
+ |
['{a260576d-a07d-4a66-b02d-1b72543fd7cf}'] |
643 |
|
function GetMetaData: IMetaData; {Output Metadata} |
644 |
|
function GetSQLParams: ISQLParams;{Statement Parameters} |
645 |
< |
function GetPlan: String; |
645 |
> |
function GetPlan: AnsiString; |
646 |
|
function GetRowsAffected(var SelectCount, InsertCount, UpdateCount, DeleteCount: integer): boolean; |
647 |
|
function GetSQLStatementType: TIBSQLStatementTypes; |
648 |
< |
function GetSQLText: string; |
648 |
> |
function GetSQLText: AnsiString; |
649 |
|
function GetSQLDialect: integer; |
650 |
|
function IsPrepared: boolean; |
651 |
|
procedure Prepare(aTransaction: ITransaction=nil); |
672 |
|
found in the Interbase 6.0 API Guide. |
673 |
|
} |
674 |
|
|
675 |
< |
ITPBItem = interface(IParameterBlockItem) end; |
675 |
> |
ITPBItem = interface(IParameterBlockItem) |
676 |
> |
['{544c1f2b-7c12-4a87-a4a5-face7ea72671}'] |
677 |
> |
end; |
678 |
|
|
679 |
< |
ITPB = specialize IParameterBlock<ITPBItem>; |
679 |
> |
ITPB = interface(IParameterBlock<ITPBItem>) |
680 |
> |
['{7369b0ff-defe-437b-81fe-19b211d42d25}'] |
681 |
> |
end; |
682 |
|
|
683 |
|
{The ITransactionAction interface provides access to a Transaction once it |
684 |
|
has been initially started. After a Commit or Rollback, a transaction |
692 |
|
TTransactionCompletion = TARollback.. TACommit; |
693 |
|
|
694 |
|
ITransaction = interface |
695 |
+ |
['{30928d0e-a9d7-4c61-b7cf-14f4f38abe2a}'] |
696 |
|
function getTPB: ITPB; |
697 |
|
procedure Start(DefaultCompletion: TTransactionCompletion=taCommit); |
698 |
|
function GetInTransaction: boolean; |
720 |
|
} |
721 |
|
|
722 |
|
TEventInfo = record |
723 |
< |
EventName: string; |
723 |
> |
EventName: AnsiString; |
724 |
|
Count: integer; |
725 |
|
end; |
726 |
|
|
731 |
|
{ IEvents } |
732 |
|
|
733 |
|
IEvents = interface |
734 |
+ |
['{6a0be233-ed08-4524-889c-2e45d0c20e5f}'] |
735 |
|
procedure GetEvents(EventNames: TStrings); |
736 |
|
procedure SetEvents(EventNames: TStrings); overload; |
737 |
< |
procedure SetEvents(EventName: string); overload; |
737 |
> |
procedure SetEvents(EventName: AnsiString); overload; |
738 |
|
procedure Cancel; |
739 |
|
function ExtractEventCounts: TEventCounts; |
740 |
|
procedure WaitForEvent; |
765 |
|
TDBOperationCounts = array of TDBOperationCount; |
766 |
|
|
767 |
|
IDBInfoItem = interface |
768 |
+ |
['{eeb97b51-ec0f-473f-9f75-c1721f055fcb}'] |
769 |
|
function getItemType: byte; |
770 |
|
function getSize: integer; |
771 |
|
procedure getRawBytes(var Buffer); |
772 |
< |
function getAsString: string; |
772 |
> |
function getAsString: AnsiString; |
773 |
|
function getAsInteger: integer; |
774 |
< |
procedure DecodeIDCluster(var ConnectionType: integer; var DBFileName, DBSiteName: string); |
774 |
> |
procedure DecodeIDCluster(var ConnectionType: integer; var DBFileName, DBSiteName: AnsiString); |
775 |
|
function getAsBytes: TByteArray; |
776 |
< |
procedure DecodeVersionString(var Version: byte; var VersionString: string); |
776 |
> |
procedure DecodeVersionString(var Version: byte; var VersionString: AnsiString); |
777 |
|
function getOperationCounts: TDBOperationCounts; |
778 |
|
procedure DecodeUserNames(UserNames: TStrings); |
779 |
|
|
782 |
|
function GetItem(index: integer): IDBInfoItem; |
783 |
|
function Find(ItemType: byte): IDBInfoItem; |
784 |
|
property AsInteger: integer read getAsInteger; |
785 |
< |
property AsString: string read GetAsString; |
785 |
> |
property AsString: AnsiString read GetAsString; |
786 |
|
property Count: integer read GetCount; |
787 |
|
property Items[index: integer]: IDBInfoItem read getItem; default; |
788 |
|
end; |
790 |
|
{ IDBInformation } |
791 |
|
|
792 |
|
IDBInformation = interface |
793 |
+ |
['{7ac6777f-f0a9-498a-9f5c-4a57a554df81}'] |
794 |
|
function GetCount: integer; |
795 |
|
function GetItem(index: integer): IDBInfoItem; |
796 |
|
function Find(ItemType: byte): IDBInfoItem; |
810 |
|
found in the Interbase 6.0 API Guide. |
811 |
|
} |
812 |
|
|
813 |
< |
IDPBItem = interface(IParameterBlockItem) end; |
813 |
> |
IDPBItem = interface(IParameterBlockItem) |
814 |
> |
['{123d4ad0-087a-4cd1-a344-1b3d03b30673}'] |
815 |
> |
end; |
816 |
|
|
817 |
< |
IDPB = specialize IParameterBlock<IDPBItem>; |
817 |
> |
IDPB = interface(IParameterBlock<IDPBItem>) |
818 |
> |
['{e676067b-1cf4-4eba-9256-9724f57e0d16}'] |
819 |
> |
end; |
820 |
|
|
821 |
|
{The IAttachment interface provides access to a Database Connection. It may be |
822 |
|
used to: |
846 |
|
{ IAttachment } |
847 |
|
|
848 |
|
IAttachment = interface |
849 |
+ |
['{466e9b67-9def-4807-b3e7-e08a35e7185c}'] |
850 |
|
function getDPB: IDPB; |
851 |
|
function AllocateBPB: IBPB; |
852 |
|
procedure Connect; |
855 |
|
procedure DropDatabase; |
856 |
|
function StartTransaction(TPB: array of byte; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload; |
857 |
|
function StartTransaction(TPB: ITPB; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload; |
858 |
< |
procedure ExecImmediate(transaction: ITransaction; sql: string; SQLDialect: integer); overload; |
859 |
< |
procedure ExecImmediate(TPB: array of byte; sql: string; SQLDialect: integer); overload; |
860 |
< |
procedure ExecImmediate(transaction: ITransaction; sql: string); overload; |
861 |
< |
procedure ExecImmediate(TPB: array of byte; sql: string); overload; |
862 |
< |
function ExecuteSQL(TPB: array of byte; sql: string; SQLDialect: integer; params: array of const): IResults; overload; |
863 |
< |
function ExecuteSQL(transaction: ITransaction; sql: string; SQLDialect: integer; params: array of const): IResults; overload; |
864 |
< |
function ExecuteSQL(TPB: array of byte; sql: string; params: array of const): IResults; overload; |
865 |
< |
function ExecuteSQL(transaction: ITransaction; sql: string; params: array of const): IResults; overload; |
866 |
< |
function OpenCursor(transaction: ITransaction; sql: string; aSQLDialect: integer): IResultSet; overload; |
867 |
< |
function OpenCursor(transaction: ITransaction; sql: string; aSQLDialect: integer; |
858 |
> |
procedure ExecImmediate(transaction: ITransaction; sql: AnsiString; SQLDialect: integer); overload; |
859 |
> |
procedure ExecImmediate(TPB: array of byte; sql: AnsiString; SQLDialect: integer); overload; |
860 |
> |
procedure ExecImmediate(transaction: ITransaction; sql: AnsiString); overload; |
861 |
> |
procedure ExecImmediate(TPB: array of byte; sql: AnsiString); overload; |
862 |
> |
function ExecuteSQL(TPB: array of byte; sql: AnsiString; SQLDialect: integer; params: array of const): IResults; overload; |
863 |
> |
function ExecuteSQL(transaction: ITransaction; sql: AnsiString; SQLDialect: integer; params: array of const): IResults; overload; |
864 |
> |
function ExecuteSQL(TPB: array of byte; sql: AnsiString; params: array of const): IResults; overload; |
865 |
> |
function ExecuteSQL(transaction: ITransaction; sql: AnsiString; params: array of const): IResults; overload; |
866 |
> |
function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IResultSet; overload; |
867 |
> |
function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer; |
868 |
|
params: array of const): IResultSet; overload; |
869 |
< |
function OpenCursor(transaction: ITransaction; sql: string): IResultSet; overload; |
870 |
< |
function OpenCursor(transaction: ITransaction; sql: string; |
869 |
> |
function OpenCursor(transaction: ITransaction; sql: AnsiString): IResultSet; overload; |
870 |
> |
function OpenCursor(transaction: ITransaction; sql: AnsiString; |
871 |
|
params: array of const): IResultSet; overload; |
872 |
< |
function OpenCursorAtStart(transaction: ITransaction; sql: string; aSQLDialect: integer): IResultSet; overload; |
873 |
< |
function OpenCursorAtStart(transaction: ITransaction; sql: string; aSQLDialect: integer; |
872 |
> |
function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IResultSet; overload; |
873 |
> |
function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer; |
874 |
|
params: array of const): IResultSet; overload; |
875 |
< |
function OpenCursorAtStart(transaction: ITransaction; sql: string): IResultSet; overload; |
876 |
< |
function OpenCursorAtStart(transaction: ITransaction; sql: string; |
875 |
> |
function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString): IResultSet; overload; |
876 |
> |
function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; |
877 |
|
params: array of const): IResultSet; overload; |
878 |
< |
function OpenCursorAtStart(sql: string): IResultSet; overload; |
879 |
< |
function OpenCursorAtStart(sql: string; |
878 |
> |
function OpenCursorAtStart(sql: AnsiString): IResultSet; overload; |
879 |
> |
function OpenCursorAtStart(sql: AnsiString; |
880 |
|
params: array of const): IResultSet; overload; |
881 |
< |
function Prepare(transaction: ITransaction; sql: string; aSQLDialect: integer): IStatement; overload; |
882 |
< |
function Prepare(transaction: ITransaction; sql: string): IStatement; overload; |
883 |
< |
function PrepareWithNamedParameters(transaction: ITransaction; sql: string; |
881 |
> |
function Prepare(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IStatement; overload; |
882 |
> |
function Prepare(transaction: ITransaction; sql: AnsiString): IStatement; overload; |
883 |
> |
function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString; |
884 |
|
aSQLDialect: integer; GenerateParamNames: boolean=false): IStatement; overload; |
885 |
< |
function PrepareWithNamedParameters(transaction: ITransaction; sql: string; |
885 |
> |
function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString; |
886 |
|
GenerateParamNames: boolean=false): IStatement; overload; |
887 |
|
|
888 |
|
{Events} |
889 |
|
function GetEventHandler(Events: TStrings): IEvents; overload; |
890 |
< |
function GetEventHandler(Event: string): IEvents; overload; |
890 |
> |
function GetEventHandler(Event: AnsiString): IEvents; overload; |
891 |
|
|
892 |
|
{Blob - may use to open existing Blobs. However, ISQLData.AsBlob is preferred} |
893 |
|
|
894 |
< |
function CreateBlob(transaction: ITransaction; RelationName, ColumnName: string; BPB: IBPB=nil): IBlob; overload; |
894 |
> |
function CreateBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BPB: IBPB=nil): IBlob; overload; |
895 |
|
function CreateBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BPB: IBPB=nil): IBlob; overload; |
896 |
|
function CreateBlob(transaction: ITransaction; SubType: integer; CharSetID: cardinal=0; BPB: IBPB=nil): IBlob; overload; |
897 |
< |
function OpenBlob(transaction: ITransaction; RelationName, ColumnName: string; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; |
897 |
> |
function OpenBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; |
898 |
|
|
899 |
|
{Array - may use to open existing arrays. However, ISQLData.AsArray is preferred} |
900 |
|
|
901 |
< |
function OpenArray(transaction: ITransaction; RelationName, ColumnName: string; ArrayID: TISC_QUAD): IArray; |
902 |
< |
function CreateArray(transaction: ITransaction; RelationName, ColumnName: string): IArray; overload; |
901 |
> |
function OpenArray(transaction: ITransaction; RelationName, ColumnName: AnsiString; ArrayID: TISC_QUAD): IArray; |
902 |
> |
function CreateArray(transaction: ITransaction; RelationName, ColumnName: AnsiString): IArray; overload; |
903 |
|
function CreateArray(transaction: ITransaction; ArrayMetaData: IArrayMetaData): IArray; overload; |
904 |
< |
function CreateArrayMetaData(SQLType: cardinal; tableName: string; columnName: string; |
904 |
> |
function CreateArrayMetaData(SQLType: cardinal; tableName: AnsiString; columnName: AnsiString; |
905 |
|
Scale: integer; size: cardinal; charSetID: cardinal; dimensions: cardinal; |
906 |
|
bounds: TArrayBounds): IArrayMetaData; |
907 |
|
|
908 |
|
{Database Information} |
909 |
|
function GetSQLDialect: integer; |
910 |
< |
function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: string): IBlobMetaData; |
911 |
< |
function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: string): IArrayMetaData; |
910 |
> |
function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IBlobMetaData; |
911 |
> |
function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IArrayMetaData; |
912 |
|
function GetDBInformation(Requests: array of byte): IDBInformation; overload; |
913 |
|
function GetDBInformation(Request: byte): IDBInformation; overload; |
914 |
|
function HasActivity: boolean; |
928 |
|
|
929 |
|
} |
930 |
|
|
931 |
< |
ISPBItem = interface(IParameterBlockItem) end; |
931 |
> |
ISPBItem = interface(IParameterBlockItem) |
932 |
> |
['{5d08ae2b-4519-41bd-8b40-97cd451c3f6a}'] |
933 |
> |
end; |
934 |
|
|
935 |
< |
ISPB = specialize IParameterBlock<ISPBItem>; |
935 |
> |
ISPB = interface(IParameterBlock<ISPBItem>) |
936 |
> |
['{2c5836fd-41ed-4426-9b7d-5af580ec2659}'] |
937 |
> |
end; |
938 |
|
|
939 |
|
{Service Query Parameter Block (SQPB). |
940 |
|
|
943 |
|
} |
944 |
|
|
945 |
|
ISQPBItem = interface(IParameterBlockItem) |
946 |
+ |
['{b07841a6-33b3-47f0-b5a2-028cbc86dc97}'] |
947 |
|
function CopyFrom(source: TStream; count: integer): integer; |
948 |
|
end; |
949 |
|
|
950 |
< |
ISQPB = specialize IParameterBlock<ISQPBItem>; |
950 |
> |
ISQPB = interface(IParameterBlock<ISQPBItem>) |
951 |
> |
['{8553e66b-ee62-498b-8431-dff030211447}'] |
952 |
> |
end; |
953 |
|
|
954 |
|
{Service Request Block (SRB). |
955 |
|
|
963 |
|
|
964 |
|
} |
965 |
|
|
966 |
< |
ISRBItem = interface(IParameterBlockItem) end; |
966 |
> |
ISRBItem = interface(IParameterBlockItem) |
967 |
> |
['{47ec790e-f265-4b30-9dcd-261e51677245}'] |
968 |
> |
end; |
969 |
|
|
970 |
< |
ISRB = specialize IParameterBlock<ISRBItem>; |
970 |
> |
ISRB = interface(IParameterBlock<ISRBItem>) |
971 |
> |
['{9f2e204f-3c33-4e44-90f9-9135e95dafb9}'] |
972 |
> |
end; |
973 |
|
|
974 |
|
{The Service Query Results Interface. |
975 |
|
|
987 |
|
} |
988 |
|
|
989 |
|
IServiceQueryResultSubItem = interface |
990 |
+ |
['{8a4c381e-9923-4cc9-a96b-553729248640}'] |
991 |
|
function getItemType: byte; |
992 |
|
function getSize: integer; |
993 |
|
procedure getRawBytes(var Buffer); |
994 |
< |
function getAsString: string; |
994 |
> |
function getAsString: AnsiString; |
995 |
|
function getAsInteger: integer; |
996 |
|
function getAsByte: byte; |
997 |
|
function CopyTo(stream: TStream; count: integer): integer; |
998 |
< |
property AsString: string read getAsString; |
998 |
> |
property AsString: AnsiString read getAsString; |
999 |
|
property AsInteger: integer read getAsInteger; |
1000 |
|
property AsByte: byte read getAsByte; |
1001 |
|
end; |
1002 |
|
|
1003 |
|
IServiceQueryResultItem = interface(IServiceQueryResultSubItem) |
1004 |
+ |
['{b2806886-206c-4024-8df9-5fe0a7630a5e}'] |
1005 |
|
function getCount: integer; |
1006 |
|
function getItem(index: integer): IServiceQueryResultSubItem; |
1007 |
|
function find(ItemType: byte): IServiceQueryResultSubItem; |
1010 |
|
end; |
1011 |
|
|
1012 |
|
IServiceQueryResults = interface |
1013 |
+ |
['{8fbbef7d-fe03-4409-828a-a787d34ef531}'] |
1014 |
|
function getCount: integer; |
1015 |
|
function getItem(index: integer): IServiceQueryResultItem; |
1016 |
|
function find(ItemType: byte): IServiceQueryResultItem; |
1029 |
|
{ IServiceManager } |
1030 |
|
|
1031 |
|
IServiceManager = interface |
1032 |
+ |
['{905b587d-1e1f-4e40-a3f8-a3519f852e48}'] |
1033 |
|
function getSPB: ISPB; |
1034 |
< |
function getServerName: string; |
1034 |
> |
function getServerName: AnsiString; |
1035 |
|
procedure Attach; |
1036 |
|
procedure Detach(Force: boolean=false); |
1037 |
|
function IsAttached: boolean; |
1051 |
|
} |
1052 |
|
|
1053 |
|
IFirebirdAPI = interface |
1054 |
+ |
['{edeee691-c8d3-4dcf-a780-cd7e432821d5}'] |
1055 |
|
{Database connections} |
1056 |
|
function AllocateDPB: IDPB; |
1057 |
< |
function OpenDatabase(DatabaseName: string; DPB: IDPB; RaiseExceptionOnConnectError: boolean=true): IAttachment; |
1058 |
< |
function CreateDatabase(DatabaseName: string; DPB: IDPB; RaiseExceptionOnError: boolean=true): IAttachment; overload; |
1059 |
< |
function CreateDatabase(sql: string; aSQLDialect: integer; RaiseExceptionOnError: boolean=true): IAttachment; overload; |
1057 |
> |
function OpenDatabase(DatabaseName: AnsiString; DPB: IDPB; RaiseExceptionOnConnectError: boolean=true): IAttachment; |
1058 |
> |
function CreateDatabase(DatabaseName: AnsiString; DPB: IDPB; RaiseExceptionOnError: boolean=true): IAttachment; overload; |
1059 |
> |
function CreateDatabase(sql: AnsiString; aSQLDialect: integer; RaiseExceptionOnError: boolean=true): IAttachment; overload; |
1060 |
|
|
1061 |
|
{Start Transaction against multiple databases} |
1062 |
|
function AllocateTPB: ITPB; |
1068 |
|
{Service Manager} |
1069 |
|
function HasServiceAPI: boolean; |
1070 |
|
function AllocateSPB: ISPB; |
1071 |
< |
function GetServiceManager(ServerName: string; Protocol: TProtocol; SPB: ISPB): IServiceManager; |
1071 |
> |
function GetServiceManager(ServerName: AnsiString; Protocol: TProtocol; SPB: ISPB): IServiceManager; |
1072 |
|
|
1073 |
|
{Information} |
1074 |
|
function GetStatus: IStatus; |
1075 |
|
function GetLibraryName: string; |
1076 |
|
function HasRollbackRetaining: boolean; |
1077 |
|
function IsEmbeddedServer: boolean; |
1078 |
< |
function GetImplementationVersion: string; |
1078 |
> |
function GetImplementationVersion: AnsiString; |
1079 |
|
|
1080 |
|
{Firebird 3 API} |
1081 |
|
function HasMasterIntf: boolean; |
1082 |
|
function GetIMaster: TObject; |
1083 |
|
|
1084 |
|
{utility} |
1085 |
< |
function GetCharsetName(CharSetID: integer): string; |
1085 |
> |
function GetCharsetName(CharSetID: integer): AnsiString; |
1086 |
|
function CharSetID2CodePage(CharSetID: integer; var CodePage: TSystemCodePage): boolean; |
1087 |
|
function CodePage2CharSetID(CodePage: TSystemCodePage; var CharSetID: integer): boolean; |
1088 |
< |
function CharSetName2CharSetID(CharSetName: string; var CharSetID: integer): boolean; |
1088 |
> |
function CharSetName2CharSetID(CharSetName: AnsiString; var CharSetID: integer): boolean; |
1089 |
|
function CharSetWidth(CharSetID: integer; var Width: integer): boolean; |
1090 |
|
end; |
1091 |
|
|
1103 |
|
private |
1104 |
|
FSQLCode: Long; |
1105 |
|
public |
1106 |
< |
constructor Create(ASQLCode: Long; Msg: string); |
1106 |
> |
constructor Create(ASQLCode: Long; Msg: AnsiString); |
1107 |
|
property SQLCode: Long read FSQLCode; |
1108 |
|
end; |
1109 |
|
|
1114 |
|
FIBErrorCode: Long; |
1115 |
|
public |
1116 |
|
constructor Create(Status: IStatus); overload; |
1117 |
< |
constructor Create(ASQLCode: Long; AIBErrorCode: Long; Msg: string); overload; |
1117 |
> |
constructor Create(ASQLCode: Long; AIBErrorCode: Long; Msg: AnsiString); overload; |
1118 |
|
property IBErrorCode: Long read FIBErrorCode; |
1119 |
|
end; |
1120 |
|
|
1192 |
|
|
1193 |
|
{ EIBError } |
1194 |
|
|
1195 |
< |
constructor EIBError.Create(ASQLCode: Long; Msg: string); |
1195 |
> |
constructor EIBError.Create(ASQLCode: Long; Msg: AnsiString); |
1196 |
|
begin |
1197 |
|
inherited Create(Msg); |
1198 |
|
FSQLCode := ASQLCode; |
1207 |
|
end; |
1208 |
|
|
1209 |
|
constructor EIBInterBaseError.Create(ASQLCode: Long; AIBErrorCode: Long; |
1210 |
< |
Msg: string); |
1210 |
> |
Msg: AnsiString); |
1211 |
|
begin |
1212 |
|
inherited Create(ASQLCode,Msg); |
1213 |
|
FIBErrorCode := AIBErrorCode; |