[MonetDB-users] how to select a column named "column"?
Hi all, I'm trying to reflect tables (to create a sqlalchemy backend for monetdb). I need to reflect the tables to do that and need primary keys. This information is stored in keycolumns, yet I can't seem to get the column out by itself. sql>select * from keycolumns; +------+--------+------+---+ |id |column |trunc |nr | +======+========+======+===+ |4394 |vendnum | 0 | 0 | |4393 |vendnum | 0 | 0 | +------+--------+------+---+ Timer 1.750 msec 2 rows sql>select column from keycolumns; !syntax error, unexpected COLUMN in: "select column" Timer 0.163 msec 0 rows sql>select keycolumns.column from keycolumns; !syntax error, unexpected COLUMN in: "select keycolumns.column" Advice??? thanks matt
On 15-11-2007 12:13:56 -0700, m h wrote:
Hi all,
Hi Matt ;)
I'm trying to reflect tables (to create a sqlalchemy backend for monetdb). I need to reflect the tables to do that and need primary keys.
This information is stored in keycolumns, yet I can't seem to get the column out by itself.
sql>select * from keycolumns; +------+--------+------+---+ |id |column |trunc |nr | +======+========+======+===+ |4394 |vendnum | 0 | 0 | |4393 |vendnum | 0 | 0 | +------+--------+------+---+ Timer 1.750 msec 2 rows sql>select column from keycolumns; !syntax error, unexpected COLUMN in: "select column" Timer 0.163 msec 0 rows sql>select keycolumns.column from keycolumns; !syntax error, unexpected COLUMN in: "select keycolumns.column"
You need to quote the column names, so the SQL parser knows you mean a column, e.g. select "column" from "keycolumns";
On Thu, Nov 15, 2007 at 12:13:56PM -0700, m h wrote:
Hi all,
I'm trying to reflect tables (to create a sqlalchemy backend for monetdb). I need to reflect the tables to do that and need primary keys.
This information is stored in keycolumns, yet I can't seem to get the column out by itself.
sql>select * from keycolumns; +------+--------+------+---+ |id |column |trunc |nr | +======+========+======+===+ |4394 |vendnum | 0 | 0 | |4393 |vendnum | 0 | 0 | +------+--------+------+---+ Timer 1.750 msec 2 rows sql>select column from keycolumns; !syntax error, unexpected COLUMN in: "select column" Timer 0.163 msec 0 rows sql>select keycolumns.column from keycolumns; !syntax error, unexpected COLUMN in: "select keycolumns.column"
select "column" from keycolumns; Niels
Advice???
thanks
matt
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
On Thu, Nov 15, 2007 at 12:13:56PM -0700, m h wrote:
Hi all,
I'm trying to reflect tables (to create a sqlalchemy backend for monetdb). I need to reflect the tables to do that and need primary keys.
This information is stored in keycolumns, yet I can't seem to get the column out by itself.
sql>select * from keycolumns; +------+--------+------+---+ |id |column |trunc |nr | +======+========+======+===+ |4394 |vendnum | 0 | 0 | |4393 |vendnum | 0 | 0 | +------+--------+------+---+ Timer 1.750 msec 2 rows sql>select column from keycolumns; !syntax error, unexpected COLUMN in: "select column" Timer 0.163 msec 0 rows sql>select keycolumns.column from keycolumns; !syntax error, unexpected COLUMN in: "select keycolumns.column"
Advice???
to use key-words as identifiers, you need to quote them, i.e., select "column" from keycolumns; Stefan
thanks
matt
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- | 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 (4)
-
Fabian Groffen
-
m h
-
Niels Nes
-
Stefan Manegold