* Martin Engelschalk <[email protected]>:
> 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.

Thanks. Unfortunately I don't have a choice. An application I don't have
control over expects such strange table names.

p...@rick



> 
> 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
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to