home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / DBDEMO.ZIP / DEMOFLS.ZIP / ARI.TXT < prev    next >
Text File  |  1991-07-01  |  1KB  |  45 lines

  1.          Application Remote Interface (ARI)
  2.  
  3.  
  4. This program shows the performance impact of Application
  5. Remote Interface (ARI), an OS/2 term for Remote Procedure
  6. Call.
  7.  
  8. The median value is being found for the column C_ENDBAL
  9. from table CHECKING.  The module noari() uses the SQL
  10. queries:
  11.  
  12.  
  13.      EXEC SQL SELECT COUNT(*)
  14.          INTO :num_rows
  15.          FROM BMCHUGH.CHECKING;
  16.  
  17.  
  18.      EXEC SQL DECLARE CBLOCK CURSOR FOR
  19.         SELECT C_ENDBAL FROM BMCHUGH.CHECKING
  20.         ORDER BY C_ENDBAL;
  21.  
  22.  
  23. Then the cursor CBLOCK is used num_rows/2 times to FETCH
  24. the desired median balance.
  25.  
  26. In the ARI version the module arir() uses the ari call:
  27.  
  28.       sqleproc("aris.dll\\get_total", NULL, NULL, out_sqlda, &sqlca);
  29.  
  30. which in turn calls the remote function get_total(), stored
  31. on the server in the DLL aris.dll which is in a subdirectory in
  32. the LIBPATH of the server.
  33.  
  34. The get_total function carries out the necessary operations
  35. mentioned above and returns the median balance in the data
  36. structure out_sqlda.  Since the operations are performed on
  37. the server only one trip is made between the server and the
  38. requester, with substantial savings in communication cost,
  39. even over record blocking.
  40.  
  41.  
  42. CONCEPTS:
  43.  
  44. Application Remote Interface, sqleproc, SQLDA for ARI, making
  45. DLL's, memory allocation.