tags:

views:

134

answers:

2

The following SQL will not accepted by HSQLDB because of the name 'position' is a keyword.

CREATE MEMORY TABLE bb (position bigint)

How to create this table without changing the column name?

+1  A: 

I don't know HSQLDB, but some SQLs let you use special quotes to force them to accept reserved identifiers.

I'd suggest trying first single quotes, then backticks. If that doesn't work, someone else will hopefully have posted something that does! :)

Carl Smotricz
In case I didn't make that clear, I meant to try quoting 'position' and ``position`` .
Carl Smotricz
oh, I have tried several quotes. CREATE MEMORY TABLE bb ("position" bigint) works. Thanks
zhongshu
+1  A: 

From the HSQLDB User Guide:

All keywords, can be used for database objects if they are double quoted.

So your statement should simply read:

CREATE MEMORY TABLE bb ("position" bigint)
David Hall
+1: Superior knowledge to the rescue. Sorry for grabbing that from ya!
Carl Smotricz
Not at all - I actually felt bad answering because it was really superior googling to the rescue. Glad you got the green tick.
David Hall