Defining Remote Procedures

Zim procedures can be executed remotely by means of ODBC using the CALL command. The procedure returns one or more Result Sets (Named Sets) that can be manipulated by the client. To enable this feature, a document is defined as a remote procedure.

To define a remote procedure, use the following steps:

  1. Access the Remote Procedure window from the Tools | Remote Access | Define Remote Procedures menu.
  2. Identify the procedure to be executed.

Enter a Remote Procedure name.

Select a Directory.

Select a Document.

Press OK.

  1. From this point Result Sets (Named Sets) are defined. (Parameters can be defined, see step 5.)

The Result Sets window opens after selecting 'Yes' from the message window.

Select a Directory.

Select a Set Name.

Optionally, enter a Sequence Number (SN). If you do not add a sequence number, a computed number is assigned. The SN determines the order in which the Result Sets are returned.

Press OK. You are prompted to add Result Fields. Alternatively, select Save and Add All Fields from the File menu. This saves the Result Set and adds all fields from the components of the set.

  1. To add Result Fields (Field Names):

The Result Fields window opens after selecting 'Yes' from the message window.

Select a Directory.

Select a Data Object (EntitySet or Relationship).

Select a Field Name.

The value description is set by default (from the definition in the Fields EntitySet) but can be modified.

Optionally enter a Sequence Number (SN). If you do not add a sequence number, a computed number is assigned. The SN determines the order in which the Fields are returned.

Exit the Result Fields window when all Fields have been added.

  1. From this point, Parameters can be defined.

Open the Parameters window by pressing the Parameters button.

Enter a Parameter Name.

Optionally, enter a Sequence Number (SN). If you do not add a sequence number, a computed number is assigned. The SN determines the order in which the Parameters are defined in the PROCEDURE statement of the Zim document.

Select a data type.

Enter a length.

Optionally enter a decimal length.

Select the type of parameter (in/out).

Exit the Parameters window when all Parameters have been added.

 

The Zim procedure can now be executed by means of the ODBC driver. For more information on ODBC, see About ODBC Drivers.