[MonetDB-users] Problem with colums named "begin" and "end"
Hi, I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL: sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin end FROM test; !syntax error, unexpected BEGIN in: "select id, begin" Kind regards, Markus
On 25-11-2007 22:00:10 +0100, Markus Gritsch wrote:
Hi,
I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL:
sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin end FROM test; !syntax error, unexpected BEGIN in: "select id, begin"
quote identifiers with ", quote strings with ' select "id", "begin" "end" from "test";
On Nov 25, 2007 10:02 PM, Fabian Groffen
On 25-11-2007 22:00:10 +0100, Markus Gritsch wrote:
Hi,
I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL:
sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin, end FROM test; !syntax error, unexpected BEGIN in: "select id, begin"
quote identifiers with ", quote strings with '
select "id", "begin", "end" from "test";
Ah, thank you :)
Markus, SQL sandards require to double-quote identifiers that match SQL keywords; hence, try SELECT id, "begin", "end" FROM test; Stefan On Sun, Nov 25, 2007 at 10:00:10PM +0100, Markus Gritsch wrote:
Hi,
I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL:
sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin end FROM test; !syntax error, unexpected BEGIN in: "select id, begin"
Kind regards, Markus
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
participants (3)
-
Fabian Groffen
-
Markus Gritsch
-
Stefan Manegold