73 |
|
{$IFEND} |
74 |
|
{$ENDIF} |
75 |
|
|
76 |
+ |
{$IFNDEF LEGACYFIREBIRDAPIONLY} |
77 |
|
{$DEFINE USEFIREBIRD3API} |
78 |
+ |
{$ENDIF} |
79 |
+ |
{$IFNDEF FIREBIRD3APIONLY} |
80 |
|
{$DEFINE USELEGACYFIREBIRDAPI} |
81 |
+ |
{$ENDIF} |
82 |
|
|
83 |
|
{ |
84 |
|
This unit defines the interfaces used to provide the Pascal Language |
135 |
|
{Interface version information} |
136 |
|
FBIntf_Major = 1; |
137 |
|
FBIntf_Minor = 1; |
138 |
< |
FBIntf_Release = 4; |
139 |
< |
FBIntf_Version = '1.1.4'; |
138 |
> |
FBIntf_Release = 6; |
139 |
> |
FBIntf_Version = '1.1.6'; |
140 |
|
|
141 |
|
{These include files are converted from the 'C' originals in the Firebird API |
142 |
|
and define the various constants used by the API} |
210 |
|
SQLGetSegment, SQLPutSegment, |
211 |
|
SQLExecProcedure, SQLStartTransaction, |
212 |
|
SQLCommit, SQLRollback, |
213 |
< |
SQLSelectForUpdate, SQLSetGenerator); |
213 |
> |
SQLSelectForUpdate, SQLSetGenerator, |
214 |
> |
SQLSavePoint); |
215 |
|
|
216 |
|
TFBStatusCode = cardinal; |
217 |
|
TByteArray = array of byte; |
219 |
|
IFirebirdAPI = interface; |
220 |
|
IAttachment = interface; |
221 |
|
ITransaction = interface; |
222 |
+ |
IStatement = interface; |
223 |
|
|
224 |
|
{The IParameterBlock interface provides the template for all parameter |
225 |
|
block interfaces} |
259 |
|
This interface can be accessed from IFirebirdAPI. |
260 |
|
} |
261 |
|
|
262 |
+ |
TIBDataBaseErrorMessage = (ShowSQLCode, |
263 |
+ |
ShowIBMessage, |
264 |
+ |
ShowSQLMessage); |
265 |
+ |
|
266 |
+ |
TIBDataBaseErrorMessages = set of TIBDataBaseErrorMessage; |
267 |
+ |
|
268 |
|
IStatus = interface |
269 |
|
['{34167722-af38-4831-b08a-93162d58ede3}'] |
270 |
|
function GetIBErrorCode: Long; |
419 |
|
the output of an SQL Statement. |
420 |
|
} |
421 |
|
|
422 |
+ |
TIBDateTimeFormats = (dfTimestamp, {SQL TIMESTAMP} |
423 |
+ |
dfDateTime, {SQL DATETIME} |
424 |
+ |
dfTime); {SQL TIME} |
425 |
+ |
|
426 |
|
{ IColumnMetaData } |
427 |
|
|
428 |
|
IColumnMetaData = interface |
443 |
|
function GetSize: cardinal; |
444 |
|
function GetArrayMetaData: IArrayMetaData; {Valid only for Array SQL Type} |
445 |
|
function GetBlobMetaData: IBlobMetaData; {Valid only for Blob SQL Type} |
446 |
+ |
function GetDateTimeStrLength(DateTimeFormat: TIBDateTimeFormats): integer; |
447 |
+ |
function GetStatement: IStatement; |
448 |
+ |
function GetTransaction: ITransaction; |
449 |
|
property Name: AnsiString read GetName; |
450 |
|
property Size: cardinal read GetSize; |
451 |
|
property SQLType: cardinal read GetSQLType; |
487 |
|
|
488 |
|
ISQLData = interface(IColumnMetaData) |
489 |
|
['{3f493e31-7e3f-4606-a07c-b210b9e3619d}'] |
490 |
+ |
function GetStrDataLength: short; |
491 |
|
function GetAsBoolean: boolean; |
492 |
|
function GetAsCurrency: Currency; |
493 |
|
function GetAsInt64: Int64; |
534 |
|
IResults = interface |
535 |
|
['{e836b2bb-93d1-4bbf-a8eb-7ce535de3bb5}'] |
536 |
|
function getCount: integer; |
537 |
+ |
function GetStatement: IStatement; |
538 |
|
function GetTransaction: ITransaction; |
539 |
|
function ByName(Idx: AnsiString): ISQLData; |
540 |
|
function getSQLData(index: integer): ISQLData; |
655 |
|
function getSQLParam(index: integer): ISQLParam; |
656 |
|
function ByName(Idx: AnsiString): ISQLParam ; |
657 |
|
function GetModified: Boolean; |
658 |
+ |
function GetHasCaseSensitiveParams: Boolean; |
659 |
|
property Modified: Boolean read GetModified; |
660 |
|
property Params[index: integer]: ISQLParam read getSQLParam; default; |
661 |
|
property Count: integer read getCount; |
933 |
|
function Prepare(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IStatement; overload; |
934 |
|
function Prepare(transaction: ITransaction; sql: AnsiString): IStatement; overload; |
935 |
|
function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString; |
936 |
< |
aSQLDialect: integer; GenerateParamNames: boolean=false): IStatement; overload; |
936 |
> |
aSQLDialect: integer; GenerateParamNames: boolean=false; |
937 |
> |
CaseSensitiveParams: boolean = false): IStatement; overload; |
938 |
|
function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString; |
939 |
< |
GenerateParamNames: boolean=false): IStatement; overload; |
939 |
> |
GenerateParamNames: boolean=false; |
940 |
> |
CaseSensitiveParams: boolean = false): IStatement; overload; |
941 |
|
|
942 |
|
{Events} |
943 |
|
function GetEventHandler(Events: TStrings): IEvents; overload; |
948 |
|
function CreateBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BPB: IBPB=nil): IBlob; overload; |
949 |
|
function CreateBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BPB: IBPB=nil): IBlob; overload; |
950 |
|
function CreateBlob(transaction: ITransaction; SubType: integer; CharSetID: cardinal=0; BPB: IBPB=nil): IBlob; overload; |
951 |
< |
function OpenBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; |
951 |
> |
function OpenBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload; |
952 |
> |
function OpenBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload; |
953 |
|
|
954 |
|
{Array - may use to open existing arrays. However, ISQLData.AsArray is preferred} |
955 |
|
|
956 |
< |
function OpenArray(transaction: ITransaction; RelationName, ColumnName: AnsiString; ArrayID: TISC_QUAD): IArray; |
956 |
> |
function OpenArray(transaction: ITransaction; RelationName, ColumnName: AnsiString; ArrayID: TISC_QUAD): IArray; overload; |
957 |
> |
function OpenArray(transaction: ITransaction; ArrayMetaData: IArrayMetaData; ArrayID: TISC_QUAD): IArray; overload; |
958 |
|
function CreateArray(transaction: ITransaction; RelationName, ColumnName: AnsiString): IArray; overload; |
959 |
|
function CreateArray(transaction: ITransaction; ArrayMetaData: IArrayMetaData): IArray; overload; |
960 |
|
function CreateArrayMetaData(SQLType: cardinal; tableName: AnsiString; columnName: AnsiString; |
1168 |
|
function HasRollbackRetaining: boolean; |
1169 |
|
function IsEmbeddedServer: boolean; |
1170 |
|
function GetImplementationVersion: AnsiString; |
1171 |
+ |
function GetClientMajor: integer; |
1172 |
+ |
function GetClientMinor: integer; |
1173 |
|
|
1174 |
|
{Firebird 3 API} |
1175 |
|
function HasMasterIntf: boolean; |
1209 |
|
{IB Client Exceptions} |
1210 |
|
EIBClientError = class(EIBError); |
1211 |
|
|
1184 |
– |
{IBError is used internally and by IBX to throw an EIBClientError} |
1185 |
– |
|
1186 |
– |
procedure IBError(ErrMess: TIBClientError; const Args: array of const); |
1187 |
– |
|
1212 |
|
{The Firebird API function is used to access the IFirebirdAPI interface. |
1213 |
|
|
1214 |
|
It will load the Firebird Client Library if this is not already loaded and |
1336 |
|
FIBErrorCode := AIBErrorCode; |
1337 |
|
end; |
1338 |
|
|
1315 |
– |
procedure IBError(ErrMess: TIBClientError; const Args: array of const); |
1316 |
– |
begin |
1317 |
– |
raise EIBClientError.Create(Ord(ErrMess), |
1318 |
– |
Format(GetErrorMessage(ErrMess), Args)); |
1319 |
– |
end; |
1339 |
|
|
1340 |
|
initialization |
1341 |
|
FDefaultFBLibrary := nil; |