248 |
|
ITransaction = interface; |
249 |
|
IStatement = interface; |
250 |
|
|
251 |
+ |
{The IFBNumeric interface provides a managed type for Fixed Point integers |
252 |
+ |
used to hold Firebird Numeric(m,n) types} |
253 |
+ |
|
254 |
+ |
IFBNumeric = interface |
255 |
+ |
['{8bdccfe9-d552-446b-bd82-844ca264455d}'] |
256 |
+ |
function getRawValue: Int64; |
257 |
+ |
function getScale: integer; |
258 |
+ |
function AdjustScaleTo(aNewScale: integer): IFBNumeric; |
259 |
+ |
function getAsString: AnsiString; |
260 |
+ |
function getAsDouble: double; |
261 |
+ |
function getAsBCD: TBCD; |
262 |
+ |
function getAsInt64: Int64; {scaled} |
263 |
+ |
function getAsInteger: integer; {scaled - may be truncated} |
264 |
+ |
function getAsSmallInt: SmallInt; {scaled - may be truncated} |
265 |
+ |
function getAsCurrency: Currency; |
266 |
+ |
end; |
267 |
+ |
|
268 |
|
{The IParameterBlock interface provides the template for all parameter |
269 |
|
block interfaces} |
270 |
|
|
322 |
|
|
323 |
|
IStatus = interface |
324 |
|
['{34167722-af38-4831-b08a-93162d58ede3}'] |
325 |
+ |
function InErrorState: boolean; |
326 |
|
function GetIBErrorCode: TStatusCode; |
327 |
|
function Getsqlcode: TStatusCode; |
328 |
|
function GetMessage: AnsiString; |
329 |
|
function CheckStatusVector(ErrorCodes: array of TFBStatusCode): Boolean; |
330 |
|
function GetIBDataBaseErrorMessages: TIBDataBaseErrorMessages; |
331 |
+ |
function Clone: IStatus; |
332 |
|
procedure SetIBDataBaseErrorMessages(Value: TIBDataBaseErrorMessages); |
333 |
|
end; |
334 |
|
|
519 |
|
function GetDateTimeStrLength(DateTimeFormat: TIBDateTimeFormats): integer; |
520 |
|
function GetStatement: IStatement; |
521 |
|
function GetTransaction: ITransaction; |
522 |
+ |
function GetAttachment: IAttachment; |
523 |
|
property Name: AnsiString read GetName; |
524 |
|
property Size: cardinal read GetSize; |
525 |
|
property SQLType: cardinal read GetSQLType; |
586 |
|
function GetAsBlob(BPB: IBPB): IBlob; overload; |
587 |
|
function GetAsArray: IArray; |
588 |
|
function GetAsBCD: tBCD; |
589 |
+ |
function GetAsNumeric: IFBNumeric; |
590 |
|
property AsDate: TDateTime read GetAsDateTime; |
591 |
|
property AsBoolean:boolean read GetAsBoolean; |
592 |
|
property AsTime: TDateTime read GetAsDateTime; |
605 |
|
property AsBlob: IBlob read GetAsBlob; |
606 |
|
property AsArray: IArray read GetAsArray; |
607 |
|
property AsBCD: tBCD read GetAsBCD; |
608 |
+ |
property AsNumeric: IFBNumeric read GetAsNumeric; |
609 |
|
property IsNull: Boolean read GetIsNull; |
610 |
|
property Value: Variant read GetAsVariant; |
611 |
|
end; |
621 |
|
function getCount: integer; |
622 |
|
function GetStatement: IStatement; |
623 |
|
function GetTransaction: ITransaction; |
624 |
+ |
function GetAttachment: IAttachment; |
625 |
|
function ByName(Idx: AnsiString): ISQLData; |
626 |
|
function getSQLData(index: integer): ISQLData; |
627 |
|
procedure GetData(index: integer; var IsNull:boolean; var len: short; var data: PByte); |
683 |
|
ISQLParam = interface(IParamMetaData) |
684 |
|
['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}'] |
685 |
|
function getColMetadata: IParamMetaData; |
686 |
+ |
function GetStatement: IStatement; |
687 |
+ |
function GetTransaction: ITransaction; |
688 |
+ |
function GetAttachment: IAttachment; |
689 |
|
function GetIndex: integer; |
690 |
|
function getName: AnsiString; |
691 |
|
function GetAsBoolean: boolean; |
711 |
|
function GetAsBlob: IBlob; |
712 |
|
function GetAsArray: IArray; |
713 |
|
function GetAsBCD: tBCD; |
714 |
< |
function GetStatement: IStatement; |
689 |
< |
function GetTransaction: ITransaction; |
714 |
> |
function GetAsNumeric: IFBNumeric; |
715 |
|
procedure Clear; |
716 |
|
function GetModified: boolean; |
717 |
|
procedure SetAsBoolean(AValue: boolean); |
740 |
|
procedure SetAsQuad(aValue: TISC_QUAD); |
741 |
|
procedure SetCharSetID(aValue: cardinal); |
742 |
|
procedure SetAsBcd(aValue: tBCD); |
743 |
+ |
procedure SetAsNumeric(Value: IFBNumeric); |
744 |
|
property AsDate: TDateTime read GetAsDateTime write SetAsDate; |
745 |
|
property AsBoolean:boolean read GetAsBoolean write SetAsBoolean; |
746 |
|
property AsTime: TDateTime read GetAsDateTime write SetAsTime; |
758 |
|
property AsBlob: IBlob read GetAsBlob write SetAsBlob; |
759 |
|
property AsArray: IArray read GetAsArray write SetAsArray; |
760 |
|
property AsBCD: tBCD read GetAsBCD write SetAsBCD; |
761 |
+ |
property AsNumeric: IFBNumeric read GetAsNumeric write SetAsNumeric; |
762 |
|
property AsQuad: TISC_QUAD read GetAsQuad write SetAsQuad; |
763 |
|
property Value: Variant read GetAsVariant write SetAsVariant; |
764 |
|
property IsNull: Boolean read GetIsNull write SetIsNull; |
779 |
|
function ByName(Idx: AnsiString): ISQLParam ; |
780 |
|
function GetModified: Boolean; |
781 |
|
function GetHasCaseSensitiveParams: Boolean; |
782 |
+ |
function GetStatement: IStatement; |
783 |
+ |
function GetTransaction: ITransaction; |
784 |
+ |
function GetAttachment: IAttachment; |
785 |
+ |
procedure Clear; |
786 |
|
property Modified: Boolean read GetModified; |
787 |
|
property Params[index: integer]: ISQLParam read getSQLParam; default; |
788 |
|
property Count: integer read getCount; |
907 |
|
|
908 |
|
TTransactionAction = (TARollback, TACommit, TACommitRetaining, TARollbackRetaining); |
909 |
|
TTransactionCompletion = TARollback.. TACommit; |
910 |
+ |
TTrCompletionState = (trCommitted, trRolledback, trCommitFailed, trRollbackFailed); |
911 |
+ |
|
912 |
|
|
913 |
|
ITransaction = interface |
914 |
|
['{30928d0e-a9d7-4c61-b7cf-14f4f38abe2a}'] |
920 |
|
function GetJournalingActive(attachment: IAttachment): boolean; |
921 |
|
function GetDefaultCompletion: TTransactionCompletion; |
922 |
|
procedure PrepareForCommit; {Two phase commit - stage 1} |
923 |
< |
procedure Commit(Force: boolean=false); |
923 |
> |
function Commit(Force: boolean=false): TTrCompletionState; |
924 |
|
procedure CommitRetaining; |
925 |
|
function HasActivity: boolean; |
926 |
< |
procedure Rollback(Force: boolean=false); |
926 |
> |
function Rollback(Force: boolean=false): TTrCompletionState; |
927 |
|
procedure RollbackRetaining; |
928 |
|
function GetAttachmentCount: integer; |
929 |
|
function GetAttachment(index: integer): IAttachment; |
962 |
|
['{6a0be233-ed08-4524-889c-2e45d0c20e5f}'] |
963 |
|
procedure GetEvents(EventNames: TStrings); |
964 |
|
procedure SetEvents(EventNames: TStrings); overload; |
965 |
< |
procedure SetEvents(EventName: AnsiString); overload; |
965 |
> |
procedure SetEvents(EventName: string); overload; |
966 |
|
procedure Cancel; |
967 |
|
function ExtractEventCounts: TEventCounts; |
968 |
|
procedure WaitForEvent; |
1098 |
|
{Journaling options. Default is [joReadWriteTransactions,joModifyQueries] } |
1099 |
|
|
1100 |
|
TJournalOption = (joReadOnlyTransactions, joReadWriteTransactions, |
1101 |
< |
joModifyQueries, joReadOnlyQueries); |
1101 |
> |
joModifyQueries, joReadOnlyQueries,joNoServerTable); |
1102 |
|
|
1103 |
|
TJournalOptions = set of TJournalOption; |
1104 |
|
|
1232 |
|
function HasDecFloatSupport: boolean; |
1233 |
|
function HasBatchMode: boolean; |
1234 |
|
function HasScollableCursors: boolean; |
1235 |
< |
function HasTable(aTableName: AnsiString): boolean; |
1235 |
> |
function HasTable(aTableName: AnsiString): boolean; {case sensitive} |
1236 |
> |
function HasFunction(aFunctionName: AnsiString): boolean; {case sensitive} |
1237 |
> |
function HasProcedure(aProcName: AnsiString): boolean; {case sensitive} |
1238 |
|
|
1239 |
|
{Character Sets} |
1240 |
+ |
function GetCharSetID: integer; {connection character set} |
1241 |
|
function HasDefaultCharSet: boolean; |
1242 |
|
function GetDefaultCharSetID: integer; |
1243 |
|
function GetCharsetName(CharSetID: integer): AnsiString; |
1257 |
|
function GetJournalOptions: TJournalOptions; |
1258 |
|
function StartJournaling(aJournalLogFile: AnsiString): integer; overload; |
1259 |
|
function StartJournaling(aJournalLogFile: AnsiString; Options: TJournalOptions): integer; overload; |
1260 |
+ |
function StartJournaling(S: TStream; Options: TJournalOptions): integer; overload; |
1261 |
|
procedure StopJournaling(RetainJournal: boolean); |
1262 |
|
end; |
1263 |
|
|
1480 |
|
EIBInterBaseError = class(EIBError) |
1481 |
|
private |
1482 |
|
FIBErrorCode: Long; |
1483 |
+ |
FStatus: IStatus; |
1484 |
|
public |
1485 |
< |
constructor Create(Status: IStatus); overload; |
1485 |
> |
constructor Create(aStatus: IStatus); overload; |
1486 |
|
constructor Create(ASQLCode: Long; AIBErrorCode: Long; Msg: AnsiString); overload; |
1487 |
|
property IBErrorCode: Long read FIBErrorCode; |
1488 |
+ |
property Status: IStatus read FStatus; |
1489 |
|
end; |
1490 |
|
|
1491 |
|
{IB Client Exceptions} |
1514 |
|
|
1515 |
|
function LoadFBLibrary(aLibPathName: string): IFirebirdLibrary; |
1516 |
|
|
1517 |
< |
{$if not declared(NULL)} {Needed for Delphi} |
1517 |
> |
{$if not declared(Null)} {Needed for Delphi} |
1518 |
|
function Null: Variant; // Null standard constant |
1519 |
|
{$define NEEDNULLFUNCTION} |
1520 |
|
{$ifend} |
1613 |
|
|
1614 |
|
{ EIBInterBaseError } |
1615 |
|
|
1616 |
< |
constructor EIBInterBaseError.Create(Status: IStatus); |
1616 |
> |
constructor EIBInterBaseError.Create(aStatus: IStatus); |
1617 |
|
begin |
1618 |
< |
inherited Create(Status.Getsqlcode,Status.GetMessage); |
1619 |
< |
FIBErrorCode := Status.GetIBErrorCode; |
1618 |
> |
inherited Create(aStatus.Getsqlcode,aStatus.GetMessage); |
1619 |
> |
FIBErrorCode := aStatus.GetIBErrorCode; |
1620 |
> |
FStatus := aStatus.Clone; |
1621 |
|
end; |
1622 |
|
|
1623 |
|
constructor EIBInterBaseError.Create(ASQLCode: Long; AIBErrorCode: Long; |