Bruce Wen wrote:
If indeed necessary to insert one control character, you need insert the int value (ASCII code) of the control character, I think. Of course, the column's data type should be int or tinyint.

Note that Derby strings are UNICODE, not ASCII. The solution is dependent on what you actually want to do. If you want to store ASCII control characters, I would recommend to use an integer column. If you want to store Unicode control characters in CHAR or VARCHAR columns, you can't do that from SQL since Derby does not support feature "F393 Unicode escapes in literals" (See http://wiki.apache.org/db-derby/SQLvsDerbyFeatures).

You can insert Unicode control characters from Java through JDBC, though.


-----Original Message-----
From: John English <[email protected]>
To: [email protected]
Sent: Sat, Mar 12, 2011 12:13 am
Subject: Re: Inserting control characters in SQL

On 11/03/2011 17:46, John English wrote: > On 11/03/2011 17:42, Peter Ondruška wrote: >> Have you tried \b ? > > Hmm, silly me. I tried RTFMing -- stupid thing to do! OK, now I've tried it. It doesn't work. LENGTH('\b') == 2, not 1. Any other suggestions? ------------------------------------------------------------------------ John English | My old University of Brighton home page is still here: | http://www.it.brighton.ac.uk/staff/je ------------------------------------------------------------------------

Reply via email to