Stored Procedure


Stored Procedure


When I compiled my stored procedure I am getting following error

5863: Problem encountered during compilation phase of C code.

I have installed visual studio 2008 in my box with all the options.
Here is the result of cufconfig -0. Let me know what I am missing in my box.
I have teradata 12.00 in my box in WS2003. Thanks in advance.

Version: 5
ModTime: 1246900985
SWDistNodeID: 33
SourceDirectoryPath: D:\Program Files\NCR\Tdat\tdconfig\Teradata\tdbs_udf\usr\
CompilerTempDirectory: D:\Program Files\NCR\Tdat\TdTemp\UDFTemp\
UDFLibraryPath: D:\Program Files\NCR\Tdat\tdconfig\udflib\
CompilerPath: d:\Program Files\Microsoft Visual Studio 9.0\VC\bin\CL.EXE
LinkerPath: d:\Program Files\Microsoft Visual Studio 9.0\VC\bin\LINK.EXE
UDFServerMemPath: D:\Program Files\NCR\Tdat\TdTemp\udfsrv\
MaximumCompilations: 10
UDFServerTasks: 2
SecureServerAMPs: 20
ParallelUserServerAMPs: 2
SecureServerPEs: 20
ParallelUserServerPEs: 2
TDSPLibBase: D:\Program Files\NCR\Tdat\tdconfig\tdsplib\
SecureGroupMembership: tdatudf
CLILibPath: D:\Program Files\NCR\Teradata Client\cliv2\lib
CLIIncPath: D:\Program Files\NCR\Teradata Client\cliv2\inc


Re: Stored Procedure

I've got the same problem when I was creating a stored procedure in Teradata SQL Assistant.

What can I do to solve this problem?


Re: Stored Procedure

I am able to solve this problem by setting environment variables with missing path.
It is is very difficult to find which path is missing in the environment variable.
You need to directly execute cl.exe and find out all missing path.

Write your procedure in some file and run below script in debug mode

Diagnostic SPLDEBUG on for session;

.compile file

Check .merr file under Tdat\TdTemp\TDSPTemp for error.

Re: Stored Procedure

Thank you so much for the answer!

Could solve my some doubts I got?

- Could you tell me which path Teradata enviroment variables do you have?
- Which *.EXE should I run? CL.EXE or PCL.EXE?
- Could write a sheet of a script example using "Diagnostic SPLDEBUG on for session;
.compile file"?

One more time, Thank you so much for the attention!

Kind Regards,


Re: Stored Procedure

Yes you need to execute CL.EXE. You will get exact command in .merr file.
Enviromnet variable can be set using

Control Pannel -> System - > Advance tab -> Environment variable
add missing path in PATH variable. Don't forget to include visual studio IDE path.

You might need to create LIB variable and set library path.