chr(0) in varchar2

T-Gergely

Member³
PD truncates strings at chr(0) while Sql*Plus does not.

CREATE TABLE bug0 (a VARCHAR2(2000));
INSERT INTO bug0 VALUES ('123'||CHR(0)||'456');
SELECT * FROM bug0;
 
This is indeed a known limitation. Varchar2 is fetched as c-style zero-terminated strings, so chr(0) is interpreted as the end of the string.
 
Back
Top