Previous Topic

Next Topic

Call

Valid in: ESQL

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.

Previous Topic

Next Topic

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:

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. For this reason, 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.

Previous Topic

Next Topic

Permissions

All users are permitted to use this statement.

Previous Topic

Next Topic

Examples: Call

The following are Call statement examples:

  1. Run a default report on the employee table in the column mode.

    exec sql commit;
    exec sql call report (database='personnel',
    name='employee', mode='column');

  2. Run QBF in the append mode with the QBF name expenses, suppressing verbose messages.

    exec sql commit;
    exec sql call qbf (database='personnel',
    qbfname='expenses', flags='-mappend -s');


© 2007 Ingres Corporation. All rights reserved.