External String Literal Examples | CREATE PROCEDURE | Teradata Vantage - 17.10 - External String Literal Examples - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1184-171K
Language
English (United States)

The following examples demonstrate various external procedure external string literals.

Example 1: External String Literal Examples

The following example indicates that the source is to be obtained from the client, from absolute directory procedure_source. The file name on the server and the source file name are both sales.c. The C procedure name is sales1.

'CS¡sales¡C:\procedure_source\sales.c¡F¡sales1'

Example 2: External String Literal Examples

In the following example, the object is to be obtained from the lowest node on the server in directory /home/james/spdev/imagef.o. The file name on the server is img.o. The name of the object it retrieves is imagef.o.

'SO¡img¡/home/james/spdev/imagef.o¡F¡img_match'

Example 3: External String Literal Examples

The following example indicates that the header file sp_types.h and the C source file stdxml.c to be used for the procedure are to be found on the server.

/home/jcx/headers/sp_types.h is the relative path from the home or current client directory for the logged on user to the header file and home/jcx/src/stdxml.c is the relative path to the C source file. The procedure name in the C source code is called stdxml. Both files have the same name on the server.

'SI¡sp_types¡/home/jcx/headers/sp_types.h¡SS:stdxml¡home/jcx/src/
          stdxml.c¡F¡stdxml'

The following table summarizes the naming issues for the EXTERNAL NAME clause and its various components.

Procedure Name Source File Name Procedure Name in DBC.TVM C/C++ Procedure Name Comments
procedure_name only procedure_name procedure_name procedure_name procedure_name must be unique within its database.
procedure_name and external_procedure_name but not as 'string' external_procedure_name procedure_name procedure_name if not in 'string'

or

external_procedure_name if in 'string'
procedure_name and external_procedure_name as 'string' source_name as specified in 'string' procedure_name procedure_name if not in 'string'

or

external_procedure_name if in 'string'