How do I display a field's hidden characters in the result of a query in H2?
I have a varchar field in an h2 database that I'd like to be 开发者_开发知识库able to see each character of (including special characters like new line and carriage return).
Basically, I need to know the h2 equivalent of Oracle's dump().
rawtohex() works, but stringencode() is probably simpler, as it returns the Java encoded string:
select rawtohex('test' || char(13) || char(444));
> 0074006500730074000d01bc
select stringencode('test' || char(13) || char(444));
> test\r\u01bc
I should've kept looking. Found it in the h2 documentation: rawtohex().
精彩评论