Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQLcl Issue with csv export import

jpbenezetApr 19 2019 — edited May 3 2019

I have an issue with SQLCL and data export / import .

I try to export data with spool and select /*sql*/ and import with load but the imported data are not the same than the exported one

CREATE TABLE DATA

(

key VARCHAR2(10 CHAR),

val VARCHAR2(500 CHAR)

);

REM INSERTING into DATA

SET DEFINE OFF;

Insert into DATA (KEY,VAL) values ('01','00');

Insert into DATA (KEY,VAL) values ('02','"');

Insert into DATA (KEY,VAL) values ('03','""');

Insert into DATA (KEY,VAL) values ('04','''');

Insert into DATA (KEY,VAL) values ('05','''''');

Insert into DATA (KEY,VAL) values ('06','test "a" val ''b'';');

Insert into DATA (KEY,VAL) values ('07','$');

Insert into DATA (KEY,VAL) values ('08','\"');

Insert into DATA (KEY,VAL) values ('09','\''');

spool export_DATA_01.csv

select /*csv*/ * from DATA;

spool off

spool export_DATA_01.sql

select /*insert*/ * from DATA;

spool off

truncate table DATA;

load DATA export_DATA_01.csv

spool export_DATA_02.csv

select /*csv*/ * from DATA;

spool off

spool export_DATA_02.sql

select /*insert*/ * from DATA;

spool off

compare export_DATA_01.csv and export_DATA_02.csv

pastedImage_0.png

pastedImage_1.png

pastedImage_2.png

Comments
Post Details
Added on Apr 19 2019
3 comments
2,339 views