Calling a Teradata Macro or Stored Procedure Using SQL Passthru

x

SQL Passthru is supported for Teradata macros and stored procedures.

Macros need to be developed within Teradata using the CREATE or REPLACE MACRO command. Procedures need to be developed within Teradata using the CREATE PROCEDURE command.

You must call a macro in the same transaction mode in which it was compiled. For information about setting the transaction mode, see Setting the Transaction Mode Within a Teradata Connection. To find out which transaction mode is currently in effect, issue the HELP session command:

SQL SQLDBC HELP SESSION;
TABLE FILE SQLOUT PRINT TRANSACTION_SEMANTICS
END

Before you can call a stored procedure or a macro, you must set the connection accordingly, either using the Web Console or by issuing the SET MACRO command

SQL SQLDBC SET MACRO ON|OFF

where:

ON

Enables one to call a macro. This is the default.

OFF

Enables one to call a stored procedure.

Example: Calling a Macro

This is an example of the syntax for calling a macro:

ENGINE SQLDBC
EX SAMPLE PARM1,PARM2,PARM3...;
TABLE FILE SQLOUT
END

Example: Calling a Stored Procedure

The supported syntax to call a stored procedure is shown below.

ENGINE SQLDBC
EX SAMPLE PARM1,PARM2,PARM3...;
TABLE FILE SQLOUT
END

When using the adapter with:

  • ODBC, all scalar parameters (IN, OUT, and INOUT) are supported.
  • CLI, scalar IN parameters, and INOUT parameters in IN mode, are supported.

WebFOCUS

Feedback