ANSI Mode For Strings Comparison - NO COLLATE
This section defines the translation specification for a string in ANSI mode without the use of COLLATE.
Description
ANSI mode for string comparison and NO COLATE usages.
The ANSI mode string comparison without the use of COLLATE will apply RTRIM and UPPER as needed. The default case specification trim behavior may be taken into account, so if a column does not have a case specification in Teradata ANSI mode, Teradata will have as default CASESPECIFIC
.
Sample Source Patterns
Setup data
Comparison operation
Case 1: Column constraint is NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Case 2: Column constraint is CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Case 3: CAST NOT CASESPECIFIC column to CASESPECIFIC and database mode is ANSI Mode
The (CASESPECIFIC
) overwrite the column constraint in the table definition.
Teradata
Snowflake
Case 4: CAST CASESPECIFIC column to NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
LIKE operation
Case 1: Column constraint is NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Case 2: Column constraint is CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Case 3: CAST NOT CASESPECIFIC column to NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Case 4: CAST CASESPECIFIC column to NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
IN Operation
Case 1: Column constraint is NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Case 2: Column constraint is CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
ORDER BY clause
Notice that this functional equivalence can differ.
Case 1: Column constraint is NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Please review FDM. The order differs in the order of insertion of data.
Case 2: Column constraint is CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
GROUP BY clause
To ensure a functional equivalence, it is required to use the COLLATE expression.
Please review the SSC-EWI-TD0007 for more information.
Case 1: Column constraint is NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Case 2: Column constraint is CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
HAVING clause
The HAVING clause will use the patterns in:
Evaluation operations.
For example:
=, !=, <, >.
LIKE operation.
IN Operation.
CAST to evaluation operation.
CAST to LIKE operation.
The following sample showcases a pattern with evaluation operation.
Sample: Column constraint is NOT CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
CASE WHEN statement
The CASE WHEN
statement will use the patterns described in:
Evaluation operations.
For example:
=, !=, <, >.
LIKE operation.
IN Operation.
CAST to evaluation operation.
CAST to LIKE operation.
The following sample showcases a pattern with evaluation operation.
Teradata
Snowflake
JOIN clause
Simple scenarios are supported.
The JOIN
statement will use the patterns described in:
Evaluation operations.
For example:
=, !=, <, >.
LIKE operation.
IN Operation.
CAST to evaluation operation.
CAST to LIKE operation.
The following sample showcases a pattern with evaluation operation.
Sample: Column constraint is CASESPECIFIC and database mode is ANSI Mode
Teradata
Snowflake
Related EWIs
SSC-EWI-TD0007: GROUP BY IS NOT EQUIVALENT IN TERADATA MODE
Last updated