comparison tests/SQLcopyinto.java @ 358:a06a76170d39

When using \n in SQL strings, the strings need an E prefix.
author Sjoerd Mullender <sjoerd@acm.org>
date Thu, 09 Apr 2020 13:47:46 +0200 (2020-04-09)
parents 77b1b7e8a4b1
children f523727db392
comparison
equal deleted inserted replaced
357:f8f1617c2fb3 358:a06a76170d39
107 System.out.println("Before sending data to STDIN"); 107 System.out.println("Before sending data to STDIN");
108 108
109 // the leading 's' is essential, since it is a protocol marker 109 // the leading 's' is essential, since it is a protocol marker
110 // that should not be omitted, likewise the trailing semicolon 110 // that should not be omitted, likewise the trailing semicolon
111 mclOut.write('s'); 111 mclOut.write('s');
112 mclOut.write("COPY INTO " + tablenm + " FROM STDIN USING DELIMITERS ',','\\n';"); 112 mclOut.write("COPY INTO " + tablenm + " FROM STDIN USING DELIMITERS ',',E'\\n';");
113 mclOut.newLine(); 113 mclOut.newLine();
114 // now write the row data values as csv data lines to the STDIN stream 114 // now write the row data values as csv data lines to the STDIN stream
115 for (int i = 0; i < 40; i++) { 115 for (int i = 0; i < 40; i++) {
116 mclOut.write("" + i + ",val_" + i); 116 mclOut.write("" + i + ",val_" + i);
117 mclOut.newLine(); 117 mclOut.newLine();