aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2010-12-14 17:36:46 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2010-12-14 17:36:46 -0500
commit3cefda164ff6e271573831fa2fea0c92b1f37bcd (patch)
treec65df994277c2c874d89790237dad9995b7d29b8
parenta8968f29b0bd07fff26086887e2e4c018d2d00c1 (diff)
downloadGradeBook-3cefda164ff6e271573831fa2fea0c92b1f37bcd.tar.gz
GradeBook-3cefda164ff6e271573831fa2fea0c92b1f37bcd.zip
table is modified to add username
darcs-hash:20101214223646-067c0-e2b848222928a1672b0485a297a60ef8c1b5e995.gz
-rwxr-xr-xGradeBook.tcl19
1 files changed, 10 insertions, 9 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index 6c04ad4..7b7adf4 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -1,6 +1,6 @@
#!/bin/sh
# FILE: "/home/evmik/src/my_src/GradeBook/GradeBook.tcl"
-# LAST MODIFICATION: "Tue, 14 Dec 2010 17:23:25 -0500 (evmik)"
+# LAST MODIFICATION: "Tue, 14 Dec 2010 17:36:43 -0500 (evmik)"
# (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com>
# $Id:$
# vim:set ft=tcl: \
@@ -43,23 +43,23 @@ set dbfile "./testdb"
sqlite3 db $dbfile
proc createDB {db} {
- db eval {CREATE TABLE t1(FirstName text, LastName text, HW01 float)}
+ db eval {CREATE TABLE GradesTable(FirstName text, LastName text, UserName text, HW01 float)}
- db eval {INSERT INTO t1 VALUES('John','Lname1', 7)}
- db eval {INSERT INTO t1 VALUES('Ale','Lname2', 5)}
- db eval {INSERT INTO t1 VALUES('Dan','Lname3',9)}
- #db1 eval {ALTER TABLE t1 ADD c int }
+ db eval {INSERT INTO GradesTable VALUES('John','Lname1', 'jhn', 7)}
+ db eval {INSERT INTO GradesTable VALUES('Ale','Lname2', 'ale', 5)}
+ db eval {INSERT INTO GradesTable VALUES('Dan','Lname3', 'dan', 9)}
+ #db1 eval {ALTER TABLE GradesTable ADD c int }
}
proc htmlDBout {db {sort_col {}}} {
- #set x [db eval {SELECT * FROM t1 ORDER BY a}]
+ #set x [db eval {SELECT * FROM GradesTable ORDER BY a}]
#puts $x
global script_name
set defSortCol LastName
# testing for the existense of the sorting column
- set eval_str [list SELECT * FROM t1 ORDER BY $sort_col]
+ set eval_str [list SELECT * FROM GradesTable ORDER BY $sort_col]
set err [catch {db eval $eval_str } errStat]
if { $err } {
dbg $errStat 3
@@ -72,7 +72,7 @@ proc htmlDBout {db {sort_col {}}} {
set sort_col LastName
}
# show the table with grades
- set eval_str [list SELECT * FROM t1 ORDER BY $sort_col]
+ set eval_str [list SELECT * FROM GradesTable ORDER BY $sort_col]
set err [catch {
db eval $eval_str v {
if { $show_header } {
@@ -186,6 +186,7 @@ proc ChoseAction {action} {
}
##################### end of procs ####################################
+#createDB db
dbg [::ncgi::names] 4
dbg "sdaf dsaf $action "
ChoseAction $action