15.10 - Example: Procedure with Parameter Style SQL - Teradata Database

Teradata Database Teradata JSON

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

This example shows an SQL definition for an external stored procedure using parameter style SQL with an IN JSON parameter, and a C function that shows the corresponding parameter list.

/* Parameter Style SQL */

CREATE PROCEDURE myJSONXSP( IN a JSON(100),
               OUT phonenum VARCHAR(100) )
LANGUAGE C
NO SQL
PARAMETER STYLE SQL
EXTERNAL NAME 'CS!myJSONXSP!myJSONXSP.c';
/* C source file name: myJSONXSP.c */

void myJSONXSP (JSON_HANDLE *json_handle,
     VARCHAR_LATIN  *result, 
     int *indicator_ary,
     int *indicator_result,
     char sqlstate[6],
     SQL_TEXT extname[129],
     SQL_TEXT specific_name[129],
     SQL_TEXT error_message[257])
{
  /* body function */
}