Send feedback on this topic.
Teradata.Client.Provider
Source Code On Server
.NET Data Provider for Teradata > Developer's Guide > Working with the Teradata Database Features > External Function Creation (XSP, UDF, UDT) > Source Code On Server

In order for the source code to reside on the Advanced SQL Engine server, the following must be performed:

  1. Copy the source file to the Advanced SQL Engine server.
  2. Connect to the SQL Engine and create a TdCommand.
  3. Set the properties TdCommand.CommandType to CommandType.Text and TdCommand.CommandText to the CREATE/REPLACE DDL statement.  The External Name clause must contain S for the component location.  This indicates that the source or object is contained on the SQL Engine server.
  4. If compiler messages are to be ignored, TdCommand.ExecuteNonQuery is called. If an application requires that the messages are to be processed, TdCommand.ExecuteReader is called.

The Data Provider returns all messages generated by the compiler that is used to process the XSP or UDF.  This will include informational, warning, and error messages generated by the compiler. To retrieve these messages TdCommand.ExecuteReader must be called. 

The following is an example of a result set returned after creating an External Stored Procedure on a Teradata Server running Microsoft Windows Server 2003 Enterprise Edition.

Each line in the example is a row contained in the row set:

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

 cl   /c /Foprovider_sp.obj provider_sp.c

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

provider_sp.c
 cl   /c /Fopre_provider_sp2.obj pre_provider_sp2.c

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

pre_provider_sp2.c
 cl   /Felibudf_03f0_107.dll /LD provider_sp.obj pre_provider_sp2.obj pre_o

ledb_udf1.obj oledb_udf1.obj /link /NODEFAULTLIB:libcmt.lib udf.lib umm2.lib 

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:libudf_03f0_107.dll 
/dll 
/implib:libudf_03f0_107.lib 
/NODEFAULTLIB:libcmt.lib

udf.lib 
umm2.lib 
provider_sp.obj
pre_provider_sp2.obj
pre_oledb_udf1.obj
oledb_udf1.obj 
   Creating library libudf_03f0_107.lib and object libudf_03f0_107.exp