85 |
|
FAttachment: IAttachment; |
86 |
|
FTransaction: ITransaction; |
87 |
|
public |
88 |
< |
procedure Assign(src: Firebird.IExternalContext); |
88 |
> |
constructor Create(aController: TFBUDRController; context: Firebird.IExternalContext); |
89 |
|
function AsText: AnsiString; |
90 |
|
public |
91 |
|
{IFBUDRExternalContext} |
247 |
|
Result := ValTrue |
248 |
|
else |
249 |
|
Result := ValFalse; |
250 |
< |
end; |
251 |
< |
|
250 |
> |
end; |
251 |
> |
|
252 |
|
{ TFBUDRMessageMetadata } |
253 |
|
|
254 |
|
constructor TFBUDRMessageMetadata.Create(context: IFBUDRExternalContext; |
280 |
|
|
281 |
|
var i: integer; |
282 |
|
begin |
283 |
< |
Result := Format('Field Count = %d' + NewLineTAB,[getCount]) + |
284 |
< |
Format('Alignment = %d' + NewLineTAB,[getAlignment]) + |
285 |
< |
Format('Aligned Length = %d' + NewLineTAB,[getAlignedLength]); |
283 |
> |
Result := Format('Field Count = %d' + NewLineTAB,[getCount]); |
284 |
> |
if FMetadata.vTable.version >= 4 then |
285 |
> |
begin |
286 |
> |
Result := Result + Format('Alignment = %d' + NewLineTAB,[getAlignment]) + |
287 |
> |
Format('Aligned Length = %d' + NewLineTAB,[getAlignedLength]); |
288 |
> |
end; |
289 |
|
for i := 0 to getCount - 1 do |
290 |
|
begin |
291 |
|
Result := Result + |
294 |
|
Format('Relation Name = %s' + NewLineTAB,[getRelation(i)]) + |
295 |
|
Format('Alias Name = %s' + NewLineTAB,[getAlias(i)]) + |
296 |
|
Format('SQLType = %s' + NewLineTAB,[TSQLDataItem.GetSQLTypeName(getType(i))]) + |
297 |
< |
Format('IsNullable = %s' + NewLineTAB,[BoolToStr(isNullable(i){$ifdef FPC},'yes','no'{$endif})]) + |
297 |
> |
Format('IsNullable = %s' + NewLineTAB,[BooleanToStr(isNullable(i),'yes','no')]) + |
298 |
|
Format('SubType = %d' + NewLineTAB,[getSubType(i)]) + |
299 |
|
Format('Length = %d' + NewLineTAB,[getLength(i)]) + |
300 |
|
Format('Scale = %d' + NewLineTAB,[getScale(i)]) + |
552 |
|
|
553 |
|
{ TFBUDRExternalContext } |
554 |
|
|
555 |
< |
procedure TFBUDRExternalContext.Assign(src: Firebird.IExternalContext); |
556 |
< |
|
554 |
< |
function SameTransaction: boolean; |
555 |
< |
var tr1, tr2: Firebird.ITransaction; |
556 |
< |
begin |
557 |
< |
Result := false; |
558 |
< |
if FContext = nil then Exit; |
559 |
< |
tr1 := src.getTransaction(FStatus); |
560 |
< |
CheckStatus; |
561 |
< |
tr2 := FContext.getTransaction(FStatus); |
562 |
< |
CheckStatus; |
563 |
< |
Result := tr1 = tr2; |
564 |
< |
end; |
565 |
< |
|
566 |
< |
function SameAttachment: boolean; |
567 |
< |
var at1, at2: Firebird.IAttachment; |
568 |
< |
begin |
569 |
< |
Result := false; |
570 |
< |
if FContext = nil then Exit; |
571 |
< |
at1 := src.getAttachment(FStatus); |
572 |
< |
CheckStatus; |
573 |
< |
at2 := FContext.getAttachment(FStatus); |
574 |
< |
CheckStatus; |
575 |
< |
Result := at1 = at2; |
576 |
< |
end; |
577 |
< |
|
555 |
> |
constructor TFBUDRExternalContext.Create(aController: TFBUDRController; |
556 |
> |
context: Firebird.IExternalContext); |
557 |
|
begin |
558 |
< |
if src = FContext then Exit; |
559 |
< |
|
560 |
< |
if src = nil then |
582 |
< |
begin |
583 |
< |
FirebirdAPI := nil; |
584 |
< |
FTransaction := nil; |
585 |
< |
FAttachment := nil; |
586 |
< |
FContext := nil; |
587 |
< |
end |
588 |
< |
else |
589 |
< |
begin |
590 |
< |
if (FContext = nil) or (src.getMaster() <> FContext.getMaster) then |
591 |
< |
FirebirdAPI := TFB30ClientAPI.Create(src.getMaster); |
592 |
< |
|
593 |
< |
if not SameTransaction then |
594 |
< |
FTransaction := nil; |
595 |
< |
|
596 |
< |
if not SameAttachment then |
597 |
< |
FAttachment := nil; |
598 |
< |
|
599 |
< |
FContext := src; |
600 |
< |
end; |
558 |
> |
inherited Create(aController); |
559 |
> |
FContext := context; |
560 |
> |
FirebirdAPI := TFB30ClientAPI.Create(context.getMaster); |
561 |
|
end; |
562 |
|
|
563 |
|
function TFBUDRExternalContext.AsText: AnsiString; |
634 |
|
|
635 |
|
function TFBUDRExternalContext.HasConfigFile: boolean; |
636 |
|
begin |
637 |
< |
|
637 |
> |
Result := Controller.HasConfigFile; |
638 |
|
end; |
639 |
|
|
640 |
|
function TFBUDRExternalContext.ReadConfigString(Section, Ident, |
641 |
|
DefaultValue: AnsiString): AnsiString; |
642 |
|
begin |
643 |
< |
Result := FController.ReadConfigString(Section, Ident, DefaultValue); |
643 |
> |
Result := Controller.ReadConfigString(Section, Ident, DefaultValue); |
644 |
|
end; |
645 |
|
|
646 |
|
function TFBUDRExternalContext.ReadConfigInteger(Section, Ident: AnsiString; |
647 |
|
DefaultValue: integer): integer; |
648 |
|
begin |
649 |
< |
Result := FController.ReadConfigInteger(Section, Ident, DefaultValue); |
649 |
> |
Result := Controller.ReadConfigInteger(Section, Ident, DefaultValue); |
650 |
|
end; |
651 |
|
|
652 |
|
function TFBUDRExternalContext.ReadConfigBool(Section, Ident: AnsiString; |
653 |
|
DefaultValue: boolean): boolean; |
654 |
|
begin |
655 |
< |
Result := FController.ReadConfigBool(Section, Ident, DefaultValue); |
655 |
> |
Result := Controller.ReadConfigBool(Section, Ident, DefaultValue); |
656 |
|
end; |
657 |
|
|
658 |
|
procedure TFBUDRExternalContext.WriteToLog(Msg: AnsiString); |
659 |
|
begin |
660 |
< |
FController.WriteToLog(Msg); |
660 |
> |
Controller.WriteToLog(Msg); |
661 |
|
end; |
662 |
|
|
663 |
|
|
772 |
|
Result := Format('Package Name = %s' + NewLineTAB,[getPackage]) + |
773 |
|
Format('Name = %s' + NewLineTAB,[getName]) + |
774 |
|
Format('Entry Point = %s (%s,%s,%s)' + NewLineTAB,[getEntryPoint,getModuleName,getRoutineName,getInfo]) + |
775 |
< |
Format('Body = %s' + NewLineTAB,[getBody]) + |
776 |
< |
Format('Input Metadata:' + NewLineTAB + '%s',[MetadataToText(FInputMetaData)]) + LineEnding + |
777 |
< |
Format('Output Metadata:' + NewLineTAB + '%s',[MetadataToText(FOutputMetaData)]); |
775 |
> |
Format('Body = %s' + NewLineTAB,[getBody]); |
776 |
> |
if HasInputMetaData then |
777 |
> |
Result := Result + Format('Input Metadata:' + NewLineTAB + '%s',[MetadataToText(FInputMetaData)]) + LineEnding; |
778 |
> |
if HasOutputMetaData then |
779 |
> |
Result := Result + Format('Output Metadata:' + NewLineTAB + '%s',[MetadataToText(FOutputMetaData)]); |
780 |
|
if FRoutineMetadata.getTriggerType(FStatus) > 0 then |
781 |
|
begin |
782 |
+ |
if HasTriggerMetaData then |
783 |
+ |
Result := Result + Format('Trigger Metadata:' + NewLineTAB + '%s',[MetadataToText(FTriggerMetaData)]); |
784 |
|
Result := Result + |
821 |
– |
Format('Trigger Metadata:' + NewLineTAB + '%s',[MetadataToText(FTriggerMetaData)]) + |
785 |
|
Format('Trigger Table = %s' + NewLineTAB,[getTriggerTable]) + |
786 |
|
Format('Trigger Type = %s' + NewLineTAB,[TriggerTypeToText(getTriggerType)]); |
787 |
|
end; |