External Stored Procedure

Database
Enthusiast

External Stored Procedure

Hi,

I want to execute an external Stored procedure. I am connecting to the NCR server from an WINXP machine.

I am trying to execute the script

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

Where i have the file C:\getregion.c in my machine as

/*****C source file name: getregion.c - quite simple, just for testing*****/

#define SQL_TEXT Latin_Text
#include
#include

void xsp_getregion( VARCHAR_LATIN *region, char sqlstate[6])
{
strcpy((char *)region, "ABCD");
}

The error i am getting is
SPL1075:E(L6), The left parenthesis in parameter declaration is missing
SPL1076:E(L6), The right parenthesis in parameter declaration is missing
SPL1010:E(L6), Unexpected text 'TD_GENERAL' in place of datatype attribute
SPL1048:E(L6), Unexpected text ';' in place of SPL Statement.

Can any one help me out in understanding the External procedure / Functions and how to make the above script executable / Syntatically correct?

Thanks,
Manu.
1 REPLY
Teradata Employee

Re: External Stored Procedure

You are executing this in BTEQ? (Specifier CS is not valid for ODBC.)
What version of CLIv2? You'll need at least the TTU8.0 level of drivers and utilities...