home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxsql.zip / RXSQL.DOC < prev    next >
Text File  |  1993-08-18  |  3KB  |  92 lines

  1. RXSQL.DLL - rexx interface to Sybase SQL server (for OS/2 1.x and 2.x)
  2.  
  3. Purpose: direct access to SQL servers in REXX
  4.  
  5. Syntax:
  6.  
  7.     RET = RXSQLQUERY(SERVER, DATABASE, USER, PASSWORD, QUERY, RESVAR,
  8.           ROWS, COLUMNS);
  9.  
  10.     where:
  11.  
  12.         SERVER: name of the SQL server to access
  13.         DATABASE: name of the database to be used on the server
  14.         USER: name of the user
  15.         PASSWORD: password of the user
  16.         QUERY: SQL query
  17.         RESVAR: name of the variable which receives query results (see below)
  18.         ROWS: maximum number of rows to be retrieved
  19.         COLUMNS: maximum number of columns to be retrieved
  20.  
  21.         RET: query status (see below)
  22.  
  23. Result Variable:
  24.  
  25.     RESVAR serves as the stem of the set of variables which receive
  26.     query results:
  27.  
  28.         RESVAR.0.0 : query status
  29.  
  30.             this is either "OK", "ERROR", or the last SQL message
  31.             received (severity 1 or higher).
  32.  
  33.         RESVAR.1.0 : rows received
  34.  
  35.             if this number is larger than ROWS argument, it
  36.             means the query returned more rows (including the header);
  37.             e.g., resvar.1.0 = 1 when no row is retrieved.
  38.  
  39.         RESVAR.2.0 : columns received
  40.  
  41.             if this number is larger than COLUMNS argument, it
  42.             means the query returned more columns.
  43.  
  44.         RESVAR.0.[c] : name of column c, c = 1, 2, ..., COLUMNS.
  45.  
  46.         RESVAR.[r].[c] : retrieved data row r, column c, where
  47.             r = 1, 2, ..., ROWS, and c = 1, 2, ..., COLUMNS.
  48.  
  49. Remarks:
  50.  
  51.     1) up to 8 SQL connections are "cached", so multiple requests to the same
  52.     server do not suffer from connection overhead.
  53.  
  54. --------------------------
  55.  
  56. From the author (08/18/93)
  57.  
  58.     This program was originally written for OS/2 1.3 about 2 years ago.
  59. Although this has been in production use at my company for quite a while,
  60. I can't say it is fully tested (we only use this for small queries), and 
  61. as such, feel free to modify the code to suit your needs.  The dll is a
  62. 16-bit code compiled for OS/2 1.3 (it works fine under 2.x), and it is for
  63. Sybase SQL server 16-bit dblib library (it shouldn't be too hard to convert
  64. it for the new 32-bit library).  We are mainly using Lan Server, so I don't
  65. know whether this works on Novell etc., but I assume it works as long as named
  66. pipes work...
  67.  
  68.     This routine won't return until it finishes processing.  This causes
  69. trouble if you use this routine under single-threaded PM/Rexx environments like
  70. Hockware's VisPro/Rexx or IBM's Visual Rexx.  My suggestion would be to use
  71. this call in a separate process and use Rexx queues to pass data/query to this
  72. process.  You can also use Dave Boll's great RXU11.ZIP Rexx utility package
  73. which allows you to write multi-threaded Rexx apps (and a lot more; this is a
  74. must-have package).
  75.  
  76.  
  77. If you have questions, send an email to one the following:
  78.  
  79. internet: M.NAGATA@GENIE.GEIS.COM
  80.  
  81. compuserve: 72370,2000 (Jim Pearson; please mention my name in the subject
  82. so he can forward your mail to me)
  83.  
  84. or, contact:
  85.  
  86.     Makoto Nagata
  87.  
  88.     555 California Street #5887
  89.     San Francisco, CA 94104
  90.  
  91.     (415) 622-0389
  92.