Avner Levy schrieb: > Hi, > I have a table with column names like "hit/s" and "runq-sz". > How can I escape characters like the "/" and "-" in a select statement? > for example "select hit/s, runq-sz from mytable" won't work. > Escape the name, for example with "", sqlite supports some other escapes for compat reasons too, but "" is most widespread for quoting identifiers.
See this example for the Tcl binding: % package require sqlite3 3.5.7 % sqlite3 db :memory: % db eval {create table foo ("hits/s" INTEGER, "some-thing" TEXT)} % db eval {select "hits/s" from foo} a {parray a} % db eval {insert into foo values (10, 'abc')} % db eval {select "hits/s" from foo} a {parray a} a(*) = hits/s a(hits/s) = 10 Michael -- Michael Schlenker Software Engineer CONTACT Software GmbH Tel.: +49 (421) 20153-80 Wiener Straße 1-3 Fax: +49 (421) 20153-41 28359 Bremen http://www.contact.de/ E-Mail: [EMAIL PROTECTED] Sitz der Gesellschaft: Bremen Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users