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

Comparing ibx/trunk/fbintf/client/3.0/FB30Statement.pas (file contents):
Revision 56 by tony, Mon Mar 6 10:20: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 343 | Line 344 | begin
344      else
345        result := FCharSetID;
346    end;
347 +  result := result;
348   end;
349  
350   function TIBXSQLVAR.GetCodePage: TSystemCodePage;
351   begin
352    result := CP_NONE;
353 <  with Firebird30ClientAPI do
353 >  with Statement.GetAttachment do
354       CharSetID2CodePage(GetCharSetID,result);
355   end;
356  
# Line 421 | Line 423 | begin
423    end
424    else
425      FSQLNullIndicator := nil;
426 +  Changed;
427   end;
428  
429   procedure TIBXSQLVAR.SetSQLData(AValue: PByte; len: cardinal);
# Line 430 | 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 445 | 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 606 | Line 614 | end;
614  
615   function TIBXINPUTSQLDA.GetMetaData: Firebird.IMessageMetadata;
616   begin
617 <  PackBuffer;
617 >  BuildMetadata;
618    Result := FCurMetaData;
619   end;
620  
# Line 616 | 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;
624 <
631 >  if FCurMetaData = nil then
632    with Firebird30ClientAPI do
633    begin
634      Builder := inherited MetaData.getBuilder(StatusIntf);
# Line 646 | 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 655 | 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
# Line 738 | Line 759 | begin
759          FSQLNullIndicator := nil;
760        FScale := aMetaData.getScale(StatusIntf,i);
761        Check4DataBaseError;
762 <      FCharSetID :=  aMetaData.getCharSet(StatusIntf,i);
762 >      FCharSetID :=  aMetaData.getCharSet(StatusIntf,i) and $FF;
763        Check4DataBaseError;
764      end;
765    end;
# Line 812 | Line 833 | begin
833          FSQLNullIndicator := nil;
834        FScale := aMetaData.getScale(StatusIntf,i);
835        Check4DataBaseError;
836 <      FCharSetID :=  aMetaData.getCharSet(StatusIntf,i);
836 >      FCharSetID :=  aMetaData.getCharSet(StatusIntf,i) and $FF;
837        Check4DataBaseError;
838      end;
839    end;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines