FUNCTION GetTotalOrdersByNumber RETURNS INTEGER (custNum AS INTEGER, threshold AS DECIMAL):
... END. ... |
namespace BigOrderInfoClient {
using Progress.Open4GL; using Progress.Open4GL.Proxy; using Progress.Open4GL.ProcedureType; public class samplecode { public static void SingleRunProcedure( ) { // Connect to the AppServer Connection myConn = new Connection ("AppServer://localhost/asbroker2", "", "", ""); OpenAppObject openAO = new OpenAppObject(myConn, "mySvc"); // Run procedure as single-run OpenProcObject openPO = openAO.CreatePO("OrderInfo/CustomerInfo.p", ProcedureType.SingleRun); // Display procedure type using ProcedureType parameter System.Console.Out.WriteLine("Procedure object procedure type: " + dynPO.ProcedureType); // Call UDF // First set up parameters System.Int32 custNum = 3; System.Decimal retVal; int Threshold = 1000; // Set up input parameters ParamArray parms = new ParamArray(2); parms.AddInteger(0, custNum, ParamArrayMode.INPUT); parms.AddDecimal(1, Threshold, ParamArrayMode.INPUT); // Set up return type parms.ReturnType = Parameter.PRO_DECIMAL; // Run UDF openPO.RunProc("GetTotalOrdersByNumber", parms); // Get return value retVal = (System.Decimal)parms.ReturnValue; // Even though the single-run procedure has been deleted on the // AppServer, use Dispose( ) to clean up the resources on the client. openPO.Dispose( ); openAO.Dispose( ); } } } |