in the following script, I can store a title with a space in it, but
I cann't select content from title which have a space in it.
package require sqlite3
catch [exec rm --force note.db]
variable tblname note
proc gettbl {} {
variable tblname
return $tblname
}
proc content {title} {
db eval [list SELECT content FROM [gettbl] where title=':title'] {
Am 06.11.21 um 04:14 schrieb luocl:
proc content {title} {
db eval [list SELECT content FROM [gettbl] where title=':title'] {
I haven't tried it, but why are there quotes '' around the title? The parameter insertion mechanism behind :title should take care of
everything so that title can be arbitrary including quotes, dollar signs
etc. In fact it doesn't do "quoting" but byte compiles the query and
links to the variable.
Christian
Thanks Rich.
Thanks Christian Gollwitzer.
This is bug in my little program https://chiselapp.com/user/LuoChunlei/repository/scrapnote
I found the bug, it took me a long time. it's not in the database side,
but in the ttk::treeview side.
ttk::treeview .tv
set item [.tv selection]
the item is a list, when item has no space, direct use item as a string
just ok; but when item has a space I need to use [lindex $item 0].
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 28:30:05 |
Calls: | 6,448 |
Files: | 12,050 |
Messages: | 5,254,516 |