"quoted name" doesn't seem to work for tables

40 views
Skip to first unread message

rajit

unread,
Jan 28, 2012, 2:40:03 AM1/28/12
to h2-da...@googlegroups.com
Hi there,

Quoting table names doesn't seem to work in H2, though the documentation indicates the availability of this feature here: http://www.h2database.com/html/grammar.html#quoted_name and here:

I'm using the latest version of H2 (1.3.163), and when I try to do:

SELECT * FROM "myTable";

I get 'table not found', though it works when I do:

SELECT * FROM myTable;

Can anyone offer any help?
Cheers!

cowwoc

unread,
Jan 30, 2012, 3:49:52 PM1/30/12
to h2-da...@googlegroups.com

My guess is you need to use backticks (`) instead of double quotes (").

Gili

> --
> You received this message because you are subscribed to the Google
> Groups "H2 Database" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/h2-database/-/DQXVXtiuz-QJ.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.

zenixan

unread,
Jan 30, 2012, 5:12:38 PM1/30/12
to H2 Database
Did you use quoted table name in the CREATE query?

On Jan 28, 9:40 am, rajit <rajit.b.si...@gmail.com> wrote:
> Hi there,
>
> Quoting table names doesn't seem to work in H2, though the documentation
> indicates the availability of this feature here:http://www.h2database.com/html/grammar.html#quoted_nameand here:http://www.h2database.com/html/grammar.html#name

rajit

unread,
Jan 31, 2012, 4:09:25 AM1/31/12
to h2-da...@googlegroups.com
Thanks very much for each of your suggestions.

zenixan, it looks like you've found the issue.  If I issue:

create table myTable;

I can successfully do "select * from myTable" but not "select * from "myTable"";

On the other hand, if I issue:

create table "myTable";

I can successfully run "select * from "myTable"", but funnily enough not "select * from myTable".

Thanks again!

Lito Lopez

unread,
Feb 1, 2012, 2:17:37 AM2/1/12
to h2-da...@googlegroups.com

From: rajit <rajit....@gmail.com>
To: h2-da...@googlegroups.com
Sent: Tuesday, January 31, 2012 1:09 AM
Subject: Re: "quoted name" doesn't seem to work for tables

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/6clwpUo8BKAJ.

Thomas Mueller

unread,
Feb 1, 2012, 3:18:24 AM2/1/12
to h2-da...@googlegroups.com
Hi Lito Lopez,

To unsubscribe, see the email footer:

> To unsubscribe from this group, send email to h2-database...@googlegroups.com.

What you did is send a mail to the group. This will not unsubscribe you.

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages