![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 24 Jan 2007 @ 09:15:41 GMT
Hello All, I am having some problem setting the error_message in UDF. The UDF is as follows; I want to set the inputErrorString value as the error_message.
#define SQL_TEXT Latin_Text
#include "sqltypes_td.h"
#include
The bteq script is as follows:
drop SPECIFIC FUNCTION unitTestFailedMessage;
create FUNCTION unitTestFailedMessage
(myval VARCHAR(257))
RETURNS INTEGER
SPECIFIC unitTestFailedMessage
LANGUAGE C
NO SQL
DETERMINISTIC
EXTERNAL NAME unitTestFailedMessage
PARAMETER STYLE SQL;
select unitTestFailedMessage('somefailure');
The following is the output of the bteq script:
*** Function has been created.
*** Warning: 5607 Check output for possible warnings encountered
in compiling nd/or linking UDF/XSP/UDM/UDT.
*** Total elapsed time was 1 second.
Check output for possible compilation warnings.
-------------------------------------------------------------
/usr/bin/cc -Xc -I /tpasw/etc -c -o
unitTestFailedMessage.ounitTestFailedMessage.c
NCR High Performance C Compiler R3.0c
(c) Copyright 1994-98, NCR Corporation
(c) Copyright 1987-98, MetaWare Incorporated
/usr/bin/cc -Xc -I /tpasw/etc -c -o
pre_unitTestFailedMessage.opre_unitTestFailedMessage.c
NCR High Performance C Compiler R3.0c
(c) Copyright 1994-98, NCR Corporation
(c) Copyright 1987-98, MetaWare Incorporated
/usr/bin/cc -G -Xc -I /tpasw/etc -o
libudf_0448_12.sounitTestFailedMessage.o pre_unitTestFailedMessage.o
\@FileList -ludf -lumm2 -lmw -lm
-lcc
+---------+---------+---------+---------+---------+---------+
select unitTestFailedMessage('somefailure');
*** Failure 7508 Corrupt stack frame for
UDF/XSP/UDMhpatel.unitTestFailedMessage.
Statement# 1, Info =0
*** Total elapsed time was 1 second.
So, how to set the error_message in UDF and how to call a UDF in stored procedure? Will appreciate your input. Thanks, Harshida
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||