15.00 - CREATE CAST/REPLACE CAST - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

CREATE CAST/
REPLACE CAST

Difference Between CREATE CAST and REPLACE CAST

If you perform a CREATE CAST statement, there must not be an existing user-defined cast that performs the same conversion, else the statement aborts and 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, else the system aborts the request, returns an error to the requestor, and does not register the method for casting.