HPlogo ALLBASE/SQL FORTRAN Application Programming Guide: HP 3000 MPE/iX Computer Systems > Chapter 9 Using Dynamic Operations

Passing Dynamic Commands to ALLBASE/SQL

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

A dynamic command is passed to ALLBASE/SQL either as a string literal or as a host variable containing a string. It must be terminated with a semicolon. The maximum length for such a string is 2048 bytes.

To pass a dynamic command that can be completely defined at programming time, you can use a delimited string:

   EXEC SQL PREPARE MyCommand FROM 'UPDATE STATISTICS FOR TABLE PurchDB.Parts;';

or

   EXEC SQL EXECUTE IMMEDIATE 'UPDATE STATISTICS FOR TABLE PurchDB.Parts;';

To pass a dynamic command that cannot be completely defined at programming time, you use a host variable declared as a string of characters:

   CHARACTER*2048    DynamicHostVar 

   .

   .

   EXECUTE IMMEDIATE :DynamicHostVar
Feedback to webmaster