Hi,
try enclosing your column name with double quotes "
create table test("column-1" varchar(255))
However, i strongly advise not to use this character, because it is the
minus-operator in sql. You will have to make sure that you enclose the
column name every time you (or somone other) uses ist.
Martin
Patrick Ben Koetter wrote:
> Can I add a column name containing a dash "-" and if yes, how would I do that?
>
> I am asking because I fail to add a column name that contains a dash "-" and I
> don't know if I cause the problem (easy solution) or if its something else
> causing this to fail.
>
> Here's what I try:
>
> sqlite> create table test(column-1 varchar(255));
> SQL error: near "-": syntax error
>
> So far I have had a look at the SQLite documentation, but couldn't find
> anything that would tell me about 'reserved' characters or how I would escape
> a dash.
>
> Thanks,
>
> p...@rick
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users