Was this helpful?
CALL
Valid in: ESQL
The CALL statement calls the operating system or an Ingres tool.
The CALL statement has the following format:
To call the operating system:
EXEC SQL CALL SYSTEM (COMMAND = command_string)
To call an Ingres 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 Ingres 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 Ingres 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 Ingres 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 Ingres 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 Ingres 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 Ingres 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: 08/28/2024