MSCEWI2031
The result may differ due to char type having a fixed length in Teradata
Severity
Description
Code Example
Input code:
CREATE TABLE table1
(
col1 VARCHAR(36),
col2 CHAR(36)
);
INSERT INTO table1 (col1, col2)
VALUES ('Mike Bird', 'Mike Bird');
SELECT REGEXP_SIMILAR(col1,'(Mike B(i|y)rd)| (Michael B(i|y)rd)') FROM table1;
--Return 1
SELECT REGEXP_SIMILAR(col2,'(Mike B(i|y)rd)| (Michael B(i|y)rd)') FROM table1;
--Return 0CREATE TABLE table1
(
col1 VARCHAR(36),
col2 CHAR(36)
);
INSERT INTO table1 VALUES ('Gabriel', 'Gabriel');
INSERT INTO table1 VALUES ('Barnum', 'Barnum');
INSERT INTO table1 VALUES ('Sergio', 'Sergio');
SELECT col1 FROM table1 where col1 LIKE 'Barnum';
-- The result is a single row with 'Barnum'
SELECT col2 FROM table1 where col2 LIKE 'Barnum';
-- It does not return any rowOutput code:
Recommendations
Last updated
