Print Thread
chr(0) in varchar2
#44359 08/08/12 10:52 AM
Joined: Aug 2011
Posts: 339
T
Member
OP Offline
Member
T
Joined: Aug 2011
Posts: 339
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;

Re: chr(0) in varchar2
T-Gergely #44367 08/09/12 09:50 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
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.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.031s Queries: 14 (0.014s) Memory: 2.4979 MB (Peak: 3.0427 MB) Data Comp: Off Server Time: 2024-05-19 10:32:51 UTC
Valid HTML 5 and Valid CSS