CREATE/REPLACE PROCEDURE SQL Statement | Teradata Vantage - CREATE PROCEDURE and REPLACE PROCEDURE (External Form) - Teradata Vantage - Analytics Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

Compiles and installs an external SQL procedure routine and creates or replaces the SQL definition used to invoke the procedure.

ANSI Compliance

This statement is ANSI SQL:2011 compliant, but includes non-ANSI Teradata extensions.

Required Privileges

The privileges required to perform CREATE PROCEDURE (External Form) and REPLACE PROCEDURE differ:
  • You must have explicit CREATE EXTERNAL PROCEDURE privileges on the database in which the external procedure is to be contained to perform the CREATE PROCEDURE (External Form) request.

    The system does not grant the CREATE EXTERNAL PROCEDURE privilege automatically when you create a database or user: you must grant that privilege explicitly.

    CREATE EXTERNAL PROCEDURE is not granted implicitly on the databases and external procedures owned by a database or user unless the owner also has an explicit WITH GRANT OPTION privilege defined for itself.

    See CREATE AUTHORIZATION and REPLACE AUTHORIZATION for further information.

  • You must have explicit DROP PROCEDURE privileges on the external procedure or on the database in which the external procedure is contained to perform the REPLACE PROCEDURE statement on an existing external procedure. You do not need the CREATE EXTERNAL PROCEDURE privilege to replace an external procedure.
  • You must have explicit CREATE EXTERNAL PROCEDURE privileges on the database in which the external procedure is to be contained to perform the REPLACE PROCEDURE statement to create a new external procedure.
If the parameter type is a UDT or an Array/Varray with a UDT element type, you must have at least one of the following privileges:
  • UDTUSAGE on the specified UDT
  • UDTUSAGE on the SYSUDTLIB database
  • UDTTYPE on the SYSUDTLIB database

See CREATE PROCEDURE and REPLACE PROCEDURE (SQL Form) for information about how to use the SQL SECURITY clause.

Privileges Granted Automatically

When you create a new procedure, Vantage automatically grants the following privileges on it.
  • DROP PROCEDURE
  • EXECUTE PROCEDURE