When using Export Dataset to export some data into insert statements, the way carriage returns are handled has changed. They are now encoded as "CHR(13)||CHR(10)" within text fields.
This causes an issue where previously the carriage return was taken as 1 character and it is now counted as 2, so when you try and run the generated insert you can get an error saying the value is too long for the field:
'Error at line 16
ORA-12899: value too large for column "DDM_TEST"."TEXT_VAL" (actual: 11, maximum: 10)'
This happens when View | Toad Options | Oracle | General | 'Newline format for character data' is set to Unix
To replicate:
1. Set: View | Toad Options | Oracle | General | 'Newline format for character data' is set to Unix
2. Run:
-- create dummy table
CREATE TABLE DDM_TEST (text_val VARCHAR2(10));
-- insert some values (both 10 characters long)
INSERT INTO DDM_TEST VALUES ('1234567890');
INSERT INTO DDM_TEST VALUES ('123456789'); -- second record contains carriage return
COMMIT;
3. Export dataset as insert statement generates:
Insert into DDM_TEST(TEXT_VAL)Values('1234567890');
Insert into DDM_TEST(TEXT_VAL)Values('123456'||CHR(13)||CHR(10)||'789');
COMMIT;
The CHR(13) is what makes the 2nd insert fail
You need to be signed in and under a current maintenance contract to view premium knowledge articles.
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center