Example: Creating a Procedure Using PARAMETER STYLE SQL - Teradata Vantage - Analytics Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-22
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

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 SQL;

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

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

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

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