8. OpenSQL Statements : CALL : Syntax
 
Share this page                  
Syntax
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.