Rexx/SQL

A Rexx interface to SQL databases

Version 2.6

16 September 2012


SQLGETINFO([connection name],variable name [,stem name])

Retrieves values from the connected database. This function is similar to SQLVARIABLE, but requires a database connection.

Like SQLVARIABLE this function returns its information in the return string, but by specifying a stem name, the results are returned in that stem variable. The stem name must include a trailing period.
The stem name option is useful for the DATATYPES option, as many databases have datatype names that contain spaces.

Arguments:

connection name
This is the connection name used when retrieving variables that require a database connection. If the connection name is not used and the variable requires a database connection, the current connection is used.

variable name
The name of the variable who's value is to be retrieved.

Returns:
with stem name specified:
the value of the variable name option in a compound variable. The compound variable consists of a stem corresponding to connection name and a tail corresponding to variable name. A return code of 0 indicates the function completed successfully, or a negative number representing an internal or database error.

with stem name NOT specified:
the value of the variable name option

The following options are valid for this function: Example: The following example shows the use of SQLGETINFO with and without a stem variable parameter:
Say "Getting mSQL datatypes with stem..."
rc = sqlgetifno("c1","DATATYPES","dt.")
Do i = 1 To dt.0
   Say i '-' dt.i
End
Say "Getting mSQL datatypes without stem..."
Say sqlgetifno(c1,"DATATYPES")

The output from the above code sample is:
Getting mSQL datatypes with stem...
1 - INT
2 - CHAR
3 - REAL
Getting mSQL datatypes without stem...
INT CHAR REAL


Copyright © Mark Hessling 1997-2012 <mark@rexx.org>


Return to Table of Contents
Last updated 16 September 2012