Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Everything E3D

Connecting Query to a Data Server

  • Last UpdatedFeb 15, 2024
  • 2 minute read

Before commands can be sent from Query to any data server, a link must be set up between the two.

To connect Query to a data server which is installed on the same machine, use one of the commands:

EXTERnal OPEn synonym token_var

EXTERnal OPEn synonym token_var [AS connect_string]

where synonym is a text string which identifies the server daemon through which communication is to be channeled (and which therefore identifies the data server required); token_var is the name of a PML variable into which a token for the connection is to be written; and (if your data server requires login data) connect_string is a text string which confirms the users access rights (such as their username and password).

Example

EXTERNAL OPEN ’MAINTENANCE’ !!MAINT AS ’bull/robert’

or

EXTERNAL OPEN ’ODBC’ !!MAINT AS ’DSN=MAINTDAT;’

To connect Query to a data server which is installed on a different machine, use the extended form of the command

EXTERnal OPEn synonym token_var ON host [AS connect_string]

where synonym, token_var and connect_string are as above and host is a text string which identifies the node on the network on which the server daemon. For example, to connect to a data server on a machine called pc35, enter

EXTERNAL OPEN ’MAINTENANCE’ !!MAINT ON ’pc35’ AS ’bull/robert’

or, alternatively, a generalised version such as

EXTERNAL OPEN ’MAINTENANCE’ !!MAINT ON ’sqlnet’ AS ’bull/robert’

where the alias ‘sqlnet’ has been defined so as to point to the current host for, say, an SQL database server.

To disconnect Query from a data server to which it is currently connected, use the command

EXTERnal CLOse token

where token is the token for the communication channel which was supplied by a successful EXTERNAL OPEN command (and stored in the token_var variable).

Example

EXTERnal CLOse $!!MAINT

Note:
The $ prefix used to expand the variable !!MAINT to give the token value.