ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/client/2.5/FB25Statement.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/2.5/FB25Statement.pas (file contents):
Revision 401 by tony, Mon Jan 10 10:13:17 2022 UTC vs.
Revision 402 by tony, Mon Aug 1 10:07:24 2022 UTC

# Line 123 | Line 123 | type
123      FStatement: TFB25Statement;
124      FFirebird25ClientAPI: TFB25ClientAPI;
125      FBlob: IBlob;             {Cache references}
126    FArray: IArray;
126      FNullIndicator: short;
127      FOwnsSQLData: boolean;
128      FBlobMetaData: IBlobMetaData;
# Line 139 | Line 138 | type
138      function GetRelationName: AnsiString;  override;
139      function GetScale: integer; override;
140      function GetCharSetID: cardinal; override;
142    function GetCodePage: TSystemCodePage; override;
143    function GetCharSetWidth: integer; override;
141      function GetIsNull: Boolean;   override;
142      function GetIsNullable: boolean; override;
143      function GetSQLData: PByte;  override;
144      function GetDataLength: cardinal; override;
145      function GetSize: cardinal; override;
149    function GetAttachment: IAttachment; override;
146      function GetDefaultTextSQLType: cardinal; override;
147      procedure SetIsNull(Value: Boolean); override;
148      procedure SetIsNullable(Value: Boolean);  override;
149      procedure SetSQLData(AValue: PByte; len: cardinal); override;
150 <    procedure SetScale(aValue: integer); override;
151 <    procedure SetDataLength(len: cardinal); override;
152 <    procedure SetSQLType(aValue: cardinal); override;
150 >    procedure InternalSetScale(aValue: integer); override;
151 >    procedure InternalSetDataLength(len: cardinal); override;
152 >    procedure InternalSetSQLType(aValue: cardinal); override;
153      procedure SetCharSetID(aValue: cardinal); override;
154    public
155      constructor Create(aParent: TIBXSQLDA; aIndex: integer);
156      procedure FreeSQLData;
157      procedure RowChange; override;
158 <    function GetAsArray(Array_ID: TISC_QUAD): IArray; override;
158 >    function GetAsArray: IArray; override;
159      function GetAsBlob(Blob_ID: TISC_QUAD; BPB: IBPB): IBlob; override;
160      function GetArrayMetaData: IArrayMetaData; override;
161      function GetBlobMetaData: IBlobMetaData; override;
# Line 193 | Line 189 | type
189    public
190      constructor Create(aStatement: TFB25Statement);
191      destructor Destroy; override;
192 +    function CanChangeMetaData: boolean; override;
193      function CheckStatementStatus(Request: TStatementStatus): boolean; override;
194      function ColumnsInUseCount: integer; override;
195      function GetTransaction: TFB25Transaction; virtual;
# Line 243 | Line 240 | type
240      function FetchAbsolute(position: Integer): boolean; {fetch record by its absolute position in result set}
241      function FetchRelative(offset: Integer): boolean; {fetch record by position relative to current}
242      function GetCursorName: AnsiString;
246    function GetTransaction: ITransaction; override;
243      function IsEof: boolean;
244      function IsBof: boolean;
245      procedure Close;
# Line 264 | Line 260 | type
260    protected
261      procedure CheckHandle; override;
262      procedure GetDsqlInfo(info_request: byte; buffer: ISQLInfoResults); override;
263 +    function GetStatementIntf: IStatement; override;
264      procedure InternalPrepare(CursorName: AnsiString=''); override;
265      function InternalExecute(aTransaction: ITransaction): IResults; override;
266      function InternalOpenCursor(aTransaction: ITransaction; Scrollable: boolean): IResultSet; override;
# Line 360 | Line 357 | begin
357    end;
358   end;
359  
363 function TIBXSQLVAR.GetCodePage: TSystemCodePage;
364 begin
365  result := CP_NONE;
366  with Statement.GetAttachment do
367     CharSetID2CodePage(GetCharSetID,result);
368 end;
369
370 function TIBXSQLVAR.GetCharSetWidth: integer;
371 begin
372  result := 1;
373  with Statement.GetAttachment DO
374    CharSetWidth(GetCharSetID,result);
375 end;
376
360   function TIBXSQLVAR.GetIsNull: Boolean;
361   begin
362    result := IsNullable and (FNullIndicator = -1);
# Line 399 | Line 382 | begin
382    Result := FMetadataSize;
383   end;
384  
402 function TIBXSQLVAR.GetAttachment: IAttachment;
403 begin
404  Result := FStatement.GetAttachment;
405 end;
406
385   function TIBXSQLVAR.GetArrayMetaData: IArrayMetaData;
386   begin
387    if GetSQLType <> SQL_ARRAY then
# Line 429 | Line 407 | begin
407    Result := FBlobMetaData;
408   end;
409  
410 < function TIBXSQLVAR.GetAsArray(Array_ID: TISC_QUAD): IArray;
410 > function TIBXSQLVAR.GetAsArray: IArray;
411   begin
412    if SQLType <> SQL_ARRAY then
413      IBError(ibxeInvalidDataConversion,[nil]);
# Line 438 | Line 416 | begin
416      Result := nil
417    else
418    begin
419 <    if FArray = nil then
420 <      FArray := TFB25Array.Create(FStatement.GetAttachment as TFB25Attachment,
419 >    if FArrayIntf = nil then
420 >      FArrayIntf := TFB25Array.Create(FStatement.GetAttachment as TFB25Attachment,
421                                    TIBXSQLDA(Parent).GetTransaction,
422 <                                  GetArrayMetaData,Array_ID);
423 <    Result := FArray;
422 >                                  GetArrayMetaData,PISC_QUAD(SQLData)^);
423 >    Result := FArrayIntf;
424    end;
425   end;
426  
# Line 551 | Line 529 | begin
529    Changed;
530   end;
531  
532 < procedure TIBXSQLVAR.SetScale(aValue: integer);
532 > procedure TIBXSQLVAR.InternalSetScale(aValue: integer);
533   begin
534    FXSQLVAR^.sqlscale := aValue;
535    Changed;
536   end;
537  
538 < procedure TIBXSQLVAR.SetDataLength(len: cardinal);
538 > procedure TIBXSQLVAR.InternalSetDataLength(len: cardinal);
539   begin
540    if not FOwnsSQLData then
541      FXSQLVAR^.sqldata := nil;
# Line 568 | Line 546 | begin
546    Changed;
547   end;
548  
549 < procedure TIBXSQLVAR.SetSQLType(aValue: cardinal);
549 > procedure TIBXSQLVAR.InternalSetSQLType(aValue: cardinal);
550   begin
551    FXSQLVAR^.sqltype := aValue or (FXSQLVAR^.sqltype and 1);
552    Changed;
# Line 614 | Line 592 | procedure TIBXSQLVAR.RowChange;
592   begin
593    inherited RowChange;
594    FBlob := nil;
617  FArray := nil;
595   end;
596  
597  
# Line 673 | Line 650 | begin
650    Result := FResults.FStatement.FCursor;
651   end;
652  
676 function TResultSet.GetTransaction: ITransaction;
677 begin
678  Result := FResults.GetTransaction;
679 end;
680
653   function TResultSet.IsEof: boolean;
654   begin
655    Result := FResults.FStatement.FEof;
# Line 754 | Line 726 | end;
726  
727   function TIBXOUTPUTSQLDA.GetTransaction: TFB25Transaction;
728   begin
729 <  Result := FTransaction;
729 >  if FTransaction <> nil then
730 >    Result := FTransaction
731 >  else
732 >    Result := inherited GetTransaction;
733   end;
734  
735   procedure TIBXOUTPUTSQLDA.GetData(index: integer; var aIsNull:boolean; var len: short;
# Line 796 | Line 771 | begin
771    inherited Destroy;
772   end;
773  
774 + function TIBXSQLDA.CanChangeMetaData: boolean;
775 + begin
776 +  Result := true;
777 + end;
778 +
779   function TIBXSQLDA.CheckStatementStatus(Request: TStatementStatus): boolean;
780   begin
781    Result := false;
# Line 975 | Line 955 | begin
955      IBDatabaseError;
956   end;
957  
958 + function TFB25Statement.GetStatementIntf: IStatement;
959 + begin
960 +  Result := self;
961 + end;
962 +
963   procedure TFB25Statement.InternalPrepare(CursorName: AnsiString);
964   var
965    GUID: TGUID;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines