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; |
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'; |
423 |
|
end |
424 |
|
else |
425 |
|
FSQLNullIndicator := nil; |
426 |
+ |
Changed; |
427 |
|
end; |
428 |
|
|
429 |
|
procedure TIBXSQLVAR.SetSQLData(AValue: PByte; len: cardinal); |
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); |
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); |
614 |
|
|
615 |
|
function TIBXINPUTSQLDA.GetMetaData: Firebird.IMessageMetadata; |
616 |
|
begin |
617 |
< |
PackBuffer; |
617 |
> |
BuildMetadata; |
618 |
|
Result := FCurMetaData; |
619 |
|
end; |
620 |
|
|
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); |
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 |
|
|
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 |