Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread drh
"Jeff Godfrey" <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm trying to determine the datatype of a given column using Tcl and the > following code snippet... > > set dataType [$db onecolumn "select typeof($colName) from $table"] > Try this: set quotedColName [string subst {" ""} $colName]

Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread Michael Schlenker
Jeff Godfrey schrieb: - Original Message - From: "Michael Schlenker" <[EMAIL PROTECTED]> set dataType [$db onecolumn {select typeof($colName) from $table}] should do what you want. Note the {} instead of the "", which prevent early substitution, so sqlite can use the $colName as a

Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread Jeff Godfrey
- Original Message - From: "Michael Schlenker" <[EMAIL PROTECTED]> set dataType [$db onecolumn {select typeof($colName) from $table}] should do what you want. Note the {} instead of the "", which prevent early substitution, so sqlite can use the $colName as a bind variable.

Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread Michael Schlenker
Jeff Godfrey schrieb: Hi All, I'm trying to determine the datatype of a given column using Tcl and the following code snippet... set dataType [$db onecolumn "select typeof($colName) from $table"] Read about the Tcl substitution rules ( http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M11 , [4]

[sqlite] sqlite / tcl syntax help

2007-02-26 Thread Jeff Godfrey
Hi All, I'm trying to determine the datatype of a given column using Tcl and the following code snippet... set dataType [$db onecolumn "select typeof($colName) from $table"] This works correctly as long as $colName (the name of the current column) doesn't contain a space. When the column