Was this helpful?
CALL
Valid in: ESQL
The CALL statement calls the operating system or an Actian X tool.
The CALL statement has the following format:
To call the operating system:
EXEC SQL CALL SYSTEM (COMMAND = command_string)
To call an Actian X tool:
EXEC SQL CALL subsystem (DATABASE = dbname {, parameter = value})
where:
command_string
Specifies the command to be executed at the operating system level when the operating system is called. If command_string is a null, empty, or blank string, the statement transfers the user to the operating system and the user can execute any operating system command. Exiting or logging out of the operating system returns the user to the application.
subsystem
Specifies the name of the Actian X tool.
dbname
Specifies the name of the current database.
parameter
Specifies one or more parameters specific to the called subsystem.
value
Specifies the value assigned to the specified parameter.
The command_string can invoke an Actian X tool. For example:
EXEC SQL CALL SYSTEM (COMMAND = 'qbf personnel');
However, it is more efficient to call the subsystem directly:
EXEC SQL CALL qbf (DATABASE = 'personnel');
When a subsystem is called directly, the database argument must identify the database to which the session is connected.
The CALL statement is not sent to the database; therefore, it cannot appear in a dynamic SQL statement string. When calling an Actian X tool, an application cannot rely on the dynamic scope of open transactions, open cursors, prepared queries, or repeated queries. The application must consider each subsystem call as an individual DBMS Server session. The Actian X tool commits any open transaction when it starts. For this reason, it is a good practice to commit before calling the subsystem.
The CALL statement allows an embedded SQL application to call the operating system or an Actian X tool (such as QBF or Report-Writer).
When used to call the operating system, this statement executes the specified command_string as if the user typed it at the operating system command line. After the command_string is executed, control returns to the application at the statement following the CALL statement.
If the CALL statement is being used to call an Actian X tool, it is more efficient to call the tool directly, rather than calling the operating system and, from there, calling the tool.
Permissions
This statement is available to all users.
Last modified date: 04/03/2024