15.10 - Example: Creating a Procedure Using PARAMETER STYLE TD_GENERAL - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

The following CREATE PROCEDURE request installs the external SQL procedure named GetRegionXSP on the Teradata platform:

   CREATE PROCEDURE GetRegionXSP
     (INOUT region VARCHAR(64))
   LANGUAGE C
   NO SQL
   EXTERNAL NAME 'CS!getregion!xspsrc/getregion.c!F!xsp_getregion'
   PARAMETER STYLE TD_GENERAL;

The only difference between this definition and the definition provided in Example: Creating a Procedure Using PARAMETER STYLE SQL is the PARAMETER STYLE declaration: this procedure uses parameter style TD_GENERAL.

The following excerpt shows the fragment of the C procedure code that declares a parameter style of TD_GENERAL:

   /*****  C source file name: getregion.c  *****/
   
   #define SQL_TEXT Latin_Text
   #include "sqltypes_td.h"
   #include <string.h>
   
   void xsp_getregion( VARCHAR_LATIN *region,
                       char           sqlstate[6])
   {
        …
   }

See SQL External Routine Programming, B035-1147 for details about coding external SQL procedures.