Difference Between CREATE CAST and REPLACE CAST - Teradata Vantage - Analytics Database

SQL Data Definition Language Detailed Topics

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
2024-12-13
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

To perform a CREATE CAST statement, a user-defined cast that performs the same conversion cannot exist or the statement returns an error to the requestor.

IF you perform a REPLACE CAST statement and there is … THEN the system …
no existing user-defined cast that performs the specified conversion creates a new user-defined cast.

The result is the same as if you had performed a CREATE CAST statement with all the same specifications.

an existing user-defined cast that performs the specified conversion replaces the existing user-defined cast definition with the newly defined cast routine.

If the cast routine is a method, then that method must be already be defined or the system returns an error to the requestor and does not register the method for casting.