Re: Is "From" a legal col name.
- From: Thomas Kellerer <WVIJEVPANEHT@xxxxxxxxxxxxx>
- Date: Mon, 17 Apr 2006 09:49:51 +0200
aaronfude@xxxxxxxxx wrote on 17.04.2006 03:54:
Hi,
This is not really a java question, but java is my platform so I'm
here.
Is "From" a legal column name? Doesn't seem so... I get a syntax error
exception. But I've inherited a database with a From column. What can I
do?
FROM is a reserved word in SQL. According to the standard, if you use a reserved word as an identifier (be it a table or a column) you have to quote it with double quotes:
SELECT "FROM" FROM the_table;
Note that most DBMS are case-sensitiv when using double quotes (I think this is also part of the ANSI definition), so maybe in your case it should read:
SELECT "From" FROM the_table;
Thomas
.
- References:
- Is "From" a legal col name.
- From: aaronfude
- Is "From" a legal col name.
- Prev by Date: Re: Derby and Tomcat
- Next by Date: Re: non-JDBC/ODBC interface to MySQL 4.1?
- Previous by thread: Is "From" a legal col name.
- Next by thread: Re: Is "From" a legal col name.
- Index(es):
Relevant Pages
|
|