Thanks for the replies.
I can now work around the problem by either converting the column name
AS to A_S and easily recode the application to use A_S in the SQL
statements and data retrieval or just make sure I quote the column name.
Other aspects of my post, thanks for the REAL pointer for the data type.
I just carried over DOUBLE as it was in the dropdown of SQLExpert when I
created a few test tables.
The Date_TS is not unique, it is just the date in seconds since epoch
and relates to a calendar month.
I shall also recode to strip the single quote from around the values if
it is a number. I again just created a test table in SQLExpert and then
loaded up a few lines of data and then exported out as a sql file and
that was how the data from SQLexpert presented the data in the export
file so I just took it as read.
Thanks for the web reference to the keywords, I looked but you can
imagine how many results you get back looking for column name as in
google etc.
Simon Slavin wrote On 11/12/2011 10:47:
On 11 Dec 2011, at 10:01am, Account 69 wrote:
Is a column name of "AS" a restricted column name in SQLlite? Can anyone point
me to a webpage that species these restricted column names or is this an error on my part
somewhere
No, you got it right:
<http://www.sqlite.org/lang_keywords.html>
The word 'AS' is used in commands like this:
SELECT (quantity * pricePerItem) AS totalPrice FROM invoiceItems
Allowing 'AS' as a column name would make parsing very difficult !
While I'm here, although your table definition will work in SQLite, it might be
worth studying up on SQLite3 datatypes so you don't trick yourself into
expecting behaviour SQLite doesn't provide.
<http://www.sqlite.org/datatype3.html>
It might be better to do
CREATE TABLE shopdata (
id INTEGER PRIMARY KEY,
date_ts INTEGER,
H_S REAL DEFAULT 0,
A_S REAL DEFAULT 0);
You did get 'INTEGER PRIMARY KEY' right, though, which most people don't.
Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users