SQL Operations on Stored Procedures | Teradata Vantage - SQL Operations on Stored Procedures - Advanced SQL Engine - Teradata Database

SQL Stored Procedures and Embedded SQL

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
xqq1557098602407.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1148
lifecycle
previous
Product Category
Teradata Vantage™
The following SQL statements execute DML, DDL, Help, and Show operations on stored procedures. You can submit most of these statements from any application on Teradata Database client utilities or interfaces.
  • ALTER PROCEDURE
  • CALL
  • CREATE PROCEDURE
  • DROP PROCEDURE
  • RENAME PROCEDURE
  • REPLACE PROCEDURE
  • HELP PROCEDURE
  • HELP ‘SPL …’
  • SHOW PROCEDURE
CREATE PROCEDURE and REPLACE PROCEDURE are supported from BTEQ, ODBC, JDBC, CLIv2 applications and from the Teradata SQL Assistant utility.

From the BTEQ and TeqTalk utilities, you must submit CREATE/REPLACE PROCEDURE statements in the file referenced by the COMPILE command.

Using Stored Procedures with Unicode Pass Through

Unicode Pass Through (UPT) is a Unicode error handling feature. The feature gives users the ability to allow Pass Through Characters (PTCs) to be imported into and exported from Teradata.

In a session where UPT is disabled, you cannot create a stored procedure that references a PTC inside the stored procedure body. Such a procedure can only be created within a Pass Through session.

When calling a stored procedure that is defined with a PTC parameter or references a PTC in the stored procedure body, the following applies:
  • In a session where UPT is disabled, you cannot call a stored procedure that is defined with a PTC parameter.
  • In a Pass Through session, you can successfully call a stored procedure that is defined with a PTC parameter and pass a PTC literal to it as an argument.
  • In all sessions (UPT enabled or disabled), you can call a stored procedure that references a PTC in the body of the the stored procedure.
The following table summarizes the usage for stored procedures with PTCs.
Stored Procedure Creation or Execution Current Session Type Expected Result
Creating a stored procedure that references a PTC in the procedure body Pass Through session Successful
UPT is disabled Error
Calling a stored procedure that is defined with a PTC parameter Pass Through session Successful
UPT is disabled Error
Calling a stored procedure that references a PTC in the procedure body Pass Through session Successful
UPT is disabled Successful
Calling a stored procedure that is defined with a PTC parameter and also references a PTC in the procedure body Pass Through session Successful
UPT is disabled Error

For more information, see Teradata Vantage™ - Advanced SQL Engine International Character Set Support, B035-1125.