Can someone please help me to understand why my substitution of the
single line that creates the table 'std'
isn't working. Any help much appreciated!
#======================================
proc msg {vlu} {tk_messageBox -message "$vlu"}
::oo::class create cDbase {
variable db tmp
constructor {} {
package require sqlite3
set tmp {}
set db {}
}
method db_open {fPth} {
sqlite3 db $fPth ;# :memory:
}
method tbl_open {nm flds} {
db eval {CREATE TABLE std( id integer primary key, epic text,
itm text, yr integer, vlu real)}
why isn't this a replacement for the line above???
#======================================================
# msg "nm=$nm\nflds=$flds"
# set script {CREATE TABLE [$nm]( id integer primary key, [$flds] )}
# db eval $script
#======================================================
db eval {INSERT INTO std VALUES(1,'mcro','revs',2003, 100000)}
db eval {INSERT INTO std VALUES(2,'mcro','revs',2004, 110000)}
set x [db eval {SELECT vlu FROM std WHERE itm='revs' ORDER BY id}]
tk_messageBox -message $x
db close
}
method add {} {
}
method destructor {} {
}
}
cDbase create d
d db_open :memory:
d tbl_open std "epic text, itm text, yr integer, vlu real"
d destroy
cDbase destroy
exit
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users