Hi,

MS SQL Server compatibility would be nice, but for me it's quite
strange to automatically convert an empty string to NULL, plus char(0)
to an empty string. How to encode char(0) then? Why not use a special
token (such as 'NULL') for NULL?

What about converting char(0) to an empty string in the query? Example:

create alias convert0 as $$
String convert0(String s) {
  return s.length() == 0 ? null : s.charAt(0) == 0 ? "" : s;
}
$$

INSERT INTO FOO.foo (STREET,STREETAD,CITY,ST,ZIP,PHONE)
SELECT convert0(street), streetad, city, st, zip, phone
FROM CSVREAD('C:\temp\testdata\foo_foo.dat', 'STREET|STREETAD|CITY|ST|ZIP|
PHONE', 'UTF-8', '|', '\n');

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to