2010/1/25 Adam DeVita <adev...@verifeye.com>:
> Create the table using single quotes around the strange name.

Double-quotes for identifiers:
http://www.sqlite.org/lang_keywords.html

>
>
> sqlite> create table x (boomer int, 'squid-nick' text);
> sqlite> insert into x values (1,'asdlh');
> sqlite> select * from x;
> 1|asdlh
> sqlite> select squid-nick from x;
> SQL error: no such column: nick
> sqlite> select 'squid-nick' from x;
> squid-nick
> /*oops, I selected the string not a column name. */
> sqlite> select x.'squid-nick' from x;  /*reference the table name before the
> column*/
> asdlh
>
>
> As an aside: If you realize that the database name for a column doesn't have
> to be the same as the user friendly name in your user interface, you don't
> have to use keywords or special characters as column names.

Good advice

>
>

Regards,
Simon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to