ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/IB.pas
(Generate patch)

Comparing:
ibx/branches/journaling/fbintf/IB.pas (file contents), Revision 364 by tony, Tue Dec 7 13:30:09 2021 UTC vs.
ibx/branches/udr/client/IB.pas (file contents), Revision 387 by tony, Wed Jan 19 13:34:42 2022 UTC

# Line 248 | Line 248 | type
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  
# Line 310 | Line 327 | type
327      function GetMessage: AnsiString;
328      function CheckStatusVector(ErrorCodes: array of TFBStatusCode): Boolean;
329      function GetIBDataBaseErrorMessages: TIBDataBaseErrorMessages;
330 +    function Clone: IStatus;
331      procedure SetIBDataBaseErrorMessages(Value: TIBDataBaseErrorMessages);
332    end;
333  
# Line 500 | Line 518 | type
518      function GetDateTimeStrLength(DateTimeFormat: TIBDateTimeFormats): integer;
519      function GetStatement: IStatement;
520      function GetTransaction: ITransaction;
521 +    function GetAttachment: IAttachment;
522      property Name: AnsiString read GetName;
523      property Size: cardinal read GetSize;
524      property SQLType: cardinal read GetSQLType;
# Line 566 | Line 585 | type
585      function GetAsBlob(BPB: IBPB): IBlob; overload;
586      function GetAsArray: IArray;
587      function GetAsBCD: tBCD;
588 +    function GetAsNumeric: IFBNumeric;
589      property AsDate: TDateTime read GetAsDateTime;
590      property AsBoolean:boolean read GetAsBoolean;
591      property AsTime: TDateTime read GetAsDateTime;
# Line 584 | Line 604 | type
604      property AsBlob: IBlob read GetAsBlob;
605      property AsArray: IArray read GetAsArray;
606      property AsBCD: tBCD read GetAsBCD;
607 +    property AsNumeric: IFBNumeric read GetAsNumeric;
608      property IsNull: Boolean read GetIsNull;
609      property Value: Variant read GetAsVariant;
610    end;
# Line 599 | Line 620 | type
620     function getCount: integer;
621     function GetStatement: IStatement;
622     function GetTransaction: ITransaction;
623 +   function GetAttachment: IAttachment;
624     function ByName(Idx: AnsiString): ISQLData;
625     function getSQLData(index: integer): ISQLData;
626     procedure GetData(index: integer; var IsNull:boolean; var len: short; var data: PByte);
# Line 660 | Line 682 | type
682    ISQLParam = interface(IParamMetaData)
683      ['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}']
684      function getColMetadata: IParamMetaData;
685 +    function GetStatement: IStatement;
686 +    function GetTransaction: ITransaction;
687 +    function GetAttachment: IAttachment;
688      function GetIndex: integer;
689      function getName: AnsiString;
690      function GetAsBoolean: boolean;
# Line 685 | Line 710 | type
710      function GetAsBlob: IBlob;
711      function GetAsArray: IArray;
712      function GetAsBCD: tBCD;
713 <    function GetStatement: IStatement;
689 <    function GetTransaction: ITransaction;
713 >    function GetAsNumeric: IFBNumeric;
714      procedure Clear;
715      function GetModified: boolean;
716      procedure SetAsBoolean(AValue: boolean);
# Line 715 | Line 739 | type
739      procedure SetAsQuad(aValue: TISC_QUAD);
740      procedure SetCharSetID(aValue: cardinal);
741      procedure SetAsBcd(aValue: tBCD);
742 +    procedure SetAsNumeric(Value: IFBNumeric);
743      property AsDate: TDateTime read GetAsDateTime write SetAsDate;
744      property AsBoolean:boolean read GetAsBoolean write SetAsBoolean;
745      property AsTime: TDateTime read GetAsDateTime write SetAsTime;
# Line 732 | Line 757 | type
757      property AsBlob: IBlob read GetAsBlob write SetAsBlob;
758      property AsArray: IArray read GetAsArray write SetAsArray;
759      property AsBCD: tBCD read GetAsBCD write SetAsBCD;
760 +    property AsNumeric: IFBNumeric read GetAsNumeric write SetAsNumeric;
761      property AsQuad: TISC_QUAD read GetAsQuad write SetAsQuad;
762      property Value: Variant read GetAsVariant write SetAsVariant;
763      property IsNull: Boolean read GetIsNull write SetIsNull;
# Line 752 | Line 778 | type
778      function ByName(Idx: AnsiString): ISQLParam ;
779      function GetModified: Boolean;
780      function GetHasCaseSensitiveParams: Boolean;
781 +    function GetStatement: IStatement;
782 +    function GetTransaction: ITransaction;
783 +    function GetAttachment: IAttachment;
784 +    procedure Clear;
785      property Modified: Boolean read GetModified;
786      property Params[index: integer]: ISQLParam read getSQLParam; default;
787      property Count: integer read getCount;
# Line 876 | Line 906 | type
906  
907    TTransactionAction  = (TARollback, TACommit, TACommitRetaining, TARollbackRetaining);
908    TTransactionCompletion = TARollback.. TACommit;
909 +  TTrCompletionState = (trCommitted, trRolledback, trCommitFailed, trRollbackFailed);
910 +
911  
912    ITransaction = interface
913      ['{30928d0e-a9d7-4c61-b7cf-14f4f38abe2a}']
# Line 887 | Line 919 | type
919      function GetJournalingActive(attachment: IAttachment): boolean;
920      function GetDefaultCompletion: TTransactionCompletion;
921      procedure PrepareForCommit; {Two phase commit - stage 1}
922 <    procedure Commit(Force: boolean=false);
922 >    function Commit(Force: boolean=false): TTrCompletionState;
923      procedure CommitRetaining;
924      function HasActivity: boolean;
925 <    procedure Rollback(Force: boolean=false);
925 >    function Rollback(Force: boolean=false): TTrCompletionState;
926      procedure RollbackRetaining;
927      function GetAttachmentCount: integer;
928      function GetAttachment(index: integer): IAttachment;
# Line 929 | Line 961 | type
961      ['{6a0be233-ed08-4524-889c-2e45d0c20e5f}']
962      procedure GetEvents(EventNames: TStrings);
963      procedure SetEvents(EventNames: TStrings); overload;
964 <    procedure SetEvents(EventName: AnsiString); overload;
964 >    procedure SetEvents(EventName: string); overload;
965      procedure Cancel;
966      function ExtractEventCounts: TEventCounts;
967      procedure WaitForEvent;
# Line 1065 | Line 1097 | type
1097     {Journaling options. Default is [joReadWriteTransactions,joModifyQueries] }
1098  
1099     TJournalOption = (joReadOnlyTransactions, joReadWriteTransactions,
1100 <                     joModifyQueries, joReadOnlyQueries);
1100 >                     joModifyQueries, joReadOnlyQueries,joNoServerTable);
1101  
1102     TJournalOptions = set of TJournalOption;
1103  
# Line 1199 | Line 1231 | type
1231      function HasDecFloatSupport: boolean;
1232      function HasBatchMode: boolean;
1233      function HasScollableCursors: boolean;
1234 <    function HasTable(aTableName: AnsiString): boolean;
1234 >    function HasTable(aTableName: AnsiString): boolean;  {case sensitive}
1235 >    function HasFunction(aFunctionName: AnsiString): boolean; {case sensitive}
1236 >    function HasProcedure(aProcName: AnsiString): boolean; {case sensitive}
1237  
1238      {Character Sets}
1239 +    function GetCharSetID: integer; {connection character set}
1240      function HasDefaultCharSet: boolean;
1241      function GetDefaultCharSetID: integer;
1242      function GetCharsetName(CharSetID: integer): AnsiString;
# Line 1221 | Line 1256 | type
1256      function GetJournalOptions: TJournalOptions;
1257      function StartJournaling(aJournalLogFile: AnsiString): integer; overload;
1258      function StartJournaling(aJournalLogFile: AnsiString; Options: TJournalOptions): integer; overload;
1259 +    function StartJournaling(S: TStream; Options: TJournalOptions): integer; overload;
1260      procedure StopJournaling(RetainJournal: boolean);
1261   end;
1262  
# Line 1443 | Line 1479 | type
1479     EIBInterBaseError = class(EIBError)
1480     private
1481       FIBErrorCode: Long;
1482 +     FStatus: IStatus;
1483     public
1484 <     constructor Create(Status: IStatus); overload;
1484 >     constructor Create(aStatus: IStatus); overload;
1485       constructor Create(ASQLCode: Long; AIBErrorCode: Long; Msg: AnsiString); overload;
1486       property IBErrorCode: Long read FIBErrorCode;
1487 +     property Status: IStatus read FStatus;
1488     end;
1489  
1490     {IB Client Exceptions}
# Line 1475 | Line 1513 | procedure CheckIBLoaded;
1513  
1514   function LoadFBLibrary(aLibPathName: string): IFirebirdLibrary;
1515  
1516 < {$if not declared(NULL)} {Needed for Delphi}
1516 > {$if not declared(Null)} {Needed for Delphi}
1517   function Null: Variant;       // Null standard constant
1518   {$define NEEDNULLFUNCTION}
1519   {$ifend}
# Line 1574 | Line 1612 | end;
1612  
1613   { EIBInterBaseError }
1614  
1615 < constructor EIBInterBaseError.Create(Status: IStatus);
1615 > constructor EIBInterBaseError.Create(aStatus: IStatus);
1616   begin
1617 <  inherited Create(Status.Getsqlcode,Status.GetMessage);
1618 <  FIBErrorCode := Status.GetIBErrorCode;
1617 >  inherited Create(aStatus.Getsqlcode,aStatus.GetMessage);
1618 >  FIBErrorCode := aStatus.GetIBErrorCode;
1619 >  FStatus := aStatus.Clone;
1620   end;
1621  
1622   constructor EIBInterBaseError.Create(ASQLCode: Long; AIBErrorCode: Long;

Comparing:
ibx/branches/journaling/fbintf/IB.pas (property svn:eol-style), Revision 364 by tony, Tue Dec 7 13:30:09 2021 UTC vs.
ibx/branches/udr/client/IB.pas (property svn:eol-style), Revision 387 by tony, Wed Jan 19 13:34:42 2022 UTC

# Line 0 | Line 1
1 + native

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines