Q_EXECUTE

Syntax

Example

Description/ Remarks

Q_EXECUTE connection_number,
"SQL Statement"

Q_EXECUTE 1,
"CREATE OR REPLACE
VIEW SPCTEST ( PARTNO) AS
SELECT PARTNO FROM VSTDS"

This command will execute an SQL statement but will not return a result set. It returns 1 if a command is successfully executed and 0 if an error occurs.

Most commonly used to run an INSERT, UPDATE, or DELETE query, or to execute a stored procedure that does not return a result set.

Connection_number : 1-10.  A template may have up to 10 distinct connections to external data sources.  A separate data buffer is maintained for each connection.

Note: The only difference between Q_START and Q_EXECUTE is that the latter doesn’ t expect a result set back.

 

To execute a stored procedure, consult your database documentation for the appropriate syntax. The simplest method of calling a stored procedure uses the following syntax:

  • Microsoft SQL Server and Oracle databases: EXEC stored_procedure_name

  • MySQL and Pervasive.SQL databases: CALL stored_procedure_name