--- ibx/branches/udr/udr/testsuite/Test01.pas 2022/01/10 10:13:17 380 +++ ibx/branches/udr/udr/testsuite/Test01.pas 2022/01/15 00:06:22 381 @@ -74,7 +74,7 @@ begin {initialize the emulator with the database connection} UDRPlugin.Attachment := Attachment; {Get the emulator wrapper for the row_count function, declared as MyRowCount} - MyRowCount := UDRPlugin.GetExternalFunction('MYROWCOUNT','','fbudrtests!row_count'); + MyRowCount := UDRPlugin.makeFunction('MYROWCOUNT','','fbudrtests!row_count'); try writeln(OutFile,'Row Count for Employee'); {set the input parameter to the EMPLOYEE table} @@ -83,13 +83,13 @@ begin ParamInfo(MyRowCount.InputParams); Transaction := Attachment.StartTransaction([isc_tpb_read,isc_tpb_nowait,isc_tpb_concurrency],taCommit); {invoke the function and print the result} - writeln('Employee Row Count = ',MyRowCount.Execute(Transaction).AsInteger); + writeln(Outfile,'Employee Row Count = ',MyRowCount.Execute(Transaction).AsInteger); writeln(OutFile); {Try again with the DEPARTMENT table} MyRowCount.InputParams[0].AsString := 'DEPARTMENT'; ParamInfo(MyRowCount.InputParams); - writeln('Dept Row Count = ',MyRowCount.Execute(Transaction).AsInteger); + writeln(Outfile,'Dept Row Count = ',MyRowCount.Execute(Transaction).AsInteger); writeln(OutFile); {And again but demonstrate exception handling by using an invalid table name} @@ -97,7 +97,7 @@ begin try ParamInfo(MyRowCount.InputParams); Rows := MyRowCount.Execute(Transaction).AsInteger; - writeln('Dept Row Count = ',Rows); + writeln(Outfile,'Dept Row Count = ',Rows); writeln(OutFile); except on E: Exception do writeln(Outfile,'Expected exception: ',E.Message); @@ -108,14 +108,14 @@ begin writeln(OutFile); {Now call the external version with an error} - MyRowCount := UDRPlugin.GetExternalFunction('BADROWCOUNT','','fbudrtests!bad_row_count'); + MyRowCount := UDRPlugin.makeFunction('BADROWCOUNT','','fbudrtests!bad_row_count'); try try writeln(OutFile,'Row Count for Employee'); MyRowCount.InputParams[0].AsString := 'EMPLOYEE'; ParamInfo(MyRowCount.InputParams); Transaction := Attachment.StartTransaction([isc_tpb_read,isc_tpb_nowait,isc_tpb_concurrency],taCommit); - writeln('Employee Row Count = ',MyRowCount.Execute(Transaction).AsInteger); + writeln(Outfile,'Employee Row Count = ',MyRowCount.Execute(Transaction).AsInteger); except on E: Exception do writeln(Outfile,'Expected exception: ',E.Message); end; @@ -132,7 +132,7 @@ var ReturnInfo: TExternalFunctionWrapper Transaction: ITransaction; begin UDRPlugin.Attachment := Attachment; - ReturnInfo := UDRPlugin.GetExternalFunction('RETURNINFO','','fbudrtests!return_info!Hello World'); + ReturnInfo := UDRPlugin.makeFunction('RETURNINFO','','fbudrtests!return_info!Hello World'); try Transaction := Attachment.StartTransaction([isc_tpb_read,isc_tpb_nowait,isc_tpb_concurrency],taCommit); writeln(OutFile,'Info returned = ',ReturnInfo.Execute(Transaction).AsString);