Thanks.
Jon
----- Original Message ----- From: "Jack Klebanoff" <[EMAIL PROTECTED]>
To: "Derby Discussion" <[email protected]>
Sent: Thursday, April 21, 2005 12:32 PM
Subject: Re: Way to quote schema/table names?
Jonathan Eric Miller wrote:
You can quote schema and table names using the standard SQL quoting mechanism: double quotes, '"'. E.g.Hi,
I'm attempting to create a table which is in a schema named "at." I think that the string "at" in some contexts is considered a reserved word, so, it's failing. Does anyone know if there is a way to get this to work? i.e. a way to quote the schema and table name or something?
[java] create table at.Department (
[java] id integer not null generated always as identity,
[java] name varchar(255),
[java] number varchar(32),
[java] title varchar(255),
[java] primary key (id)
[java] )
[java] Apr 20, 2005 4:46:23 PM org.hibernate.tool.hbm2ddl.SchemaExport execute
[java] SEVERE: Unsuccessful: create table at.Department (id integer not null generated always as identity, name varchar(255), number varchar(32), title varchar(255), primary key (id))
[java] Apr 20, 2005 4:46:23 PM org.hibernate.tool.hbm2ddl.SchemaExport exec
[java] SEVERE: Syntax error: Encountered "at" at line 1, column 14.
Jon
create schema "at"; create table "at".Department( ...);
Note that when you quote a name it becomes case sensitive. So, in the example above
select * from "AT".Department;
will not work, Derby will not find schema "AT", you must use "at" instead.
Jack Klebanoff
