Sending Commands to a Data Server
- Last UpdatedJan 24, 2023
- 2 minute read
Note:
It is assumed that the User is already familiar with the commands for communicating
with their data server; for example, the SQL commands needed to interact with an SQL
DB.
The User can send commands to the data server in one of two ways:
As individual command lines, each of which is sent as soon as the newline character is entered to terminate the command line.
-
In continuous mode, such that a sequence of command lines is concatenated and sent as a single command string. The maximum length for an individual command line is 120 characters; continuous mode allows the User to send longer command sequences.
To send an individual command line to the data server, simply prefix the command text thus:
EXTERnal SENd token command_text
Here, 'token' is the token for the communication channel which was supplied by a successful EXTERNAL OPEN command (and stored in the token_var variable) and command_text is the command string to be sent to the data server.
Example:
EXTERNAL SEND $!!MAINT ’commit’
To send a continuous command sequence to the data server, use the syntax:
EXTERnal SENd token STArt
command_text_1
command_text_2
...
END
Here, 'token' is the token for the communication channel which was supplied by a successful EXTERNAL OPEN command (and stored in the token_var variable) and command_text_1, etc. are the command strings to be sent to the data server.
Example:
EXTERNAL SEND $!!MAINT START
’select refno, description, datedue’
’from maintdata’
’where datedue<sysdate+7’
END
Here, each line of command text is terminated by a newline character.
When the 'END' command is reached, all text lines entered since 'START' are concatenated, with a space separator between each, and sent to the data server as a single command.
Note:
Command texts may include references to PML variables. The maximum length for a single
text line is 120 characters. The maximum total length for the overall text string
(that is, all lines between the START and END commands) is 4095 characters, including
the separating spaces.