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

Comparing ibx/trunk/fbintf/client/3.0/FB30Statement.pas (file contents):
Revision 67 by tony, Mon Mar 27 15:21:02 2017 UTC vs.
Revision 68 by tony, Tue Oct 17 10:07:58 2017 UTC

# Line 181 | Line 181 | type
181      function GetMetaData: Firebird.IMessageMetadata;
182      function GetModified: Boolean;
183      function GetMsgLength: integer;
184 +    procedure BuildMetadata;
185      procedure PackBuffer;
186    protected
187      procedure FreeXSQLDA; override;
# Line 270 | Line 271 | end;
271  
272   implementation
273  
274 < uses IBUtils, FBMessages, FBBLob, FB30Blob, variants,  FBArray, FB30Array;
274 > uses IBUtils, FBMessages, FBBlob, FB30Blob, variants,  FBArray, FB30Array;
275  
276   const
277    ISQL_COUNTERS = 'CurrentMemory, MaxMemory, RealTime, UserTime, Buffers, Reads, Writes, Fetches';
# Line 422 | Line 423 | begin
423    end
424    else
425      FSQLNullIndicator := nil;
426 +  Changed;
427   end;
428  
429   procedure TIBXSQLVAR.SetSQLData(AValue: PByte; len: cardinal);
# Line 431 | Line 433 | begin
433    FSQLData := AValue;
434    FDataLength := len;
435    FOwnsSQLData := false;
436 +  Changed;
437   end;
438  
439   procedure TIBXSQLVAR.SetScale(aValue: integer);
440   begin
441    FScale := aValue;
442 +  Changed;
443   end;
444  
445   procedure TIBXSQLVAR.SetDataLength(len: cardinal);
# Line 446 | Line 450 | begin
450    with Firebird30ClientAPI do
451      IBAlloc(FSQLData, 0, FDataLength);
452    FOwnsSQLData := true;
453 +  Changed;
454   end;
455  
456   procedure TIBXSQLVAR.SetSQLType(aValue: cardinal);
457   begin
458    FSQLType := aValue;
459 +  Changed;
460   end;
461  
462   procedure TIBXSQLVAR.SetCharSetID(aValue: cardinal);
463   begin
464    FCharSetID := aValue;
465 +  Changed;
466   end;
467  
468   constructor TIBXSQLVAR.Create(aParent: TIBXSQLDA; aIndex: integer);
# Line 607 | Line 614 | end;
614  
615   function TIBXINPUTSQLDA.GetMetaData: Firebird.IMessageMetadata;
616   begin
617 <  PackBuffer;
617 >  BuildMetadata;
618    Result := FCurMetaData;
619   end;
620  
# Line 617 | Line 624 | begin
624    Result := FMsgLength;
625   end;
626  
627 < procedure TIBXINPUTSQLDA.PackBuffer;
627 > procedure TIBXINPUTSQLDA.BuildMetadata;
628   var Builder: Firebird.IMetadataBuilder;
629      i: integer;
630   begin
631 <  if FMsgLength > 0 then Exit;
625 <
631 >  if FCurMetaData = nil then
632    with Firebird30ClientAPI do
633    begin
634      Builder := inherited MetaData.getBuilder(StatusIntf);
# Line 647 | Line 653 | begin
653      finally
654        Builder.release;
655      end;
656 +  end;
657 + end;
658  
659 + procedure TIBXINPUTSQLDA.PackBuffer;
660 + var i: integer;
661 + begin
662 +  BuildMetadata;
663 +
664 +  if FMsgLength = 0 then
665 +  with Firebird30ClientAPI do
666 +  begin
667      FMsgLength := FCurMetaData.getMessageLength(StatusIntf);
668      Check4DataBaseError;
669  
# Line 656 | Line 672 | begin
672      for i := 0 to Count - 1 do
673      with TIBXSQLVar(Column[i]) do
674      begin
675 +      if not Modified then
676 +        IBError(ibxeUninitializedInputParameter,[i,Name]);
677 +
678        if IsNull then
679          FillChar((FMessageBuffer + FCurMetaData.getOffset(StatusIntf,i))^,FDataLength,0)
680        else
681 +      if FSQLData <> nil then
682          Move(FSQLData^,(FMessageBuffer + FCurMetaData.getOffset(StatusIntf,i))^,FDataLength);
683        Check4DataBaseError;
684        if IsNullable then

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines