Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off upper-case for table and column names in HSQL?

How to turn off forced upper-case mode for table and column names in HSQL?

<artifactId>hsqldb</artifactId>
<version>2.3.1</version>

OS: Windows 7 x64

like image 335
Arthur Avatar asked Mar 24 '16 09:03

Arthur


People also ask

Is Hsql case sensitive?

The default embedded database (HSQL) in Confluence is a CASE SENSITIVE database.


2 Answers

The rules around this are explained in the HSQLDB documentation:

When a database object is created with one of the CREATE statements or renamed with the ALTER statement, if the name is enclosed in double quotes, the exact name is used as the case-normal form. But if it is not enclosed in double quotes, the name is converted to uppercase and this uppercase version is stored in the database as the case-normal form.

Case sensitivity rules for identifiers can be described simply as follows:

  • all parts of SQL statements are converted to upper case before processing, except identifiers in double quotes and strings in single quotes
  • identifiers, both unquoted and double quoted, are then treated as case-sensitive
  • most database engines follow the same rule, except, in some respects, MySQL and MS SQLServer.

AFAIK this behaviour can't be turned off. (It's worth noting that standard SQL is case-insensitive when quoted identifiers aren't used.) But as mentioned above, a lower case identifier can be specified by enclosing in quotes, e.g:

CREATE TABLE "lowercasetablename" ("lowercasecolname" INT);
SELECT "lowercasecolname" FROM "lowercasetablename";
like image 102
Steve Chambers Avatar answered Oct 17 '22 18:10

Steve Chambers


I am not sure, i understand the problem correctly but just trying to put some effort.

SET DATABASE COLLATION SQL_TEXT_UCC

May be you can refer http://hsqldb.org/doc/guide/dbproperties-chapt.html

like image 43
dildeepak Avatar answered Oct 17 '22 19:10

dildeepak