home *** CD-ROM | disk | FTP | other *** search
- RXSQL.DLL - rexx interface to Sybase SQL server (for OS/2 1.x and 2.x)
-
- Purpose: direct access to SQL servers in REXX
-
- Syntax:
-
- RET = RXSQLQUERY(SERVER, DATABASE, USER, PASSWORD, QUERY, RESVAR,
- ROWS, COLUMNS);
-
- where:
-
- SERVER: name of the SQL server to access
- DATABASE: name of the database to be used on the server
- USER: name of the user
- PASSWORD: password of the user
- QUERY: SQL query
- RESVAR: name of the variable which receives query results (see below)
- ROWS: maximum number of rows to be retrieved
- COLUMNS: maximum number of columns to be retrieved
-
- RET: query status (see below)
-
- Result Variable:
-
- RESVAR serves as the stem of the set of variables which receive
- query results:
-
- RESVAR.0.0 : query status
-
- this is either "OK", "ERROR", or the last SQL message
- received (severity 1 or higher).
-
- RESVAR.1.0 : rows received
-
- if this number is larger than ROWS argument, it
- means the query returned more rows (including the header);
- e.g., resvar.1.0 = 1 when no row is retrieved.
-
- RESVAR.2.0 : columns received
-
- if this number is larger than COLUMNS argument, it
- means the query returned more columns.
-
- RESVAR.0.[c] : name of column c, c = 1, 2, ..., COLUMNS.
-
- RESVAR.[r].[c] : retrieved data row r, column c, where
- r = 1, 2, ..., ROWS, and c = 1, 2, ..., COLUMNS.
-
- Remarks:
-
- 1) up to 8 SQL connections are "cached", so multiple requests to the same
- server do not suffer from connection overhead.
-
- --------------------------
-
- From the author (08/18/93)
-
- This program was originally written for OS/2 1.3 about 2 years ago.
- Although this has been in production use at my company for quite a while,
- I can't say it is fully tested (we only use this for small queries), and
- as such, feel free to modify the code to suit your needs. The dll is a
- 16-bit code compiled for OS/2 1.3 (it works fine under 2.x), and it is for
- Sybase SQL server 16-bit dblib library (it shouldn't be too hard to convert
- it for the new 32-bit library). We are mainly using Lan Server, so I don't
- know whether this works on Novell etc., but I assume it works as long as named
- pipes work...
-
- This routine won't return until it finishes processing. This causes
- trouble if you use this routine under single-threaded PM/Rexx environments like
- Hockware's VisPro/Rexx or IBM's Visual Rexx. My suggestion would be to use
- this call in a separate process and use Rexx queues to pass data/query to this
- process. You can also use Dave Boll's great RXU11.ZIP Rexx utility package
- which allows you to write multi-threaded Rexx apps (and a lot more; this is a
- must-have package).
-
-
- If you have questions, send an email to one the following:
-
- internet: M.NAGATA@GENIE.GEIS.COM
-
- compuserve: 72370,2000 (Jim Pearson; please mention my name in the subject
- so he can forward your mail to me)
-
- or, contact:
-
- Makoto Nagata
-
- 555 California Street #5887
- San Francisco, CA 94104
-
- (415) 622-0389