aboutsummaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-04-15 20:40:50 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2011-04-15 20:40:50 -0400
commite1f40958894955957fa3c8d0c2039c087d14fec4 (patch)
treeb5c494f5e6e2d7e7d0a2d0b331ad76eb5e03db21 /GradeBook_lib.tcl
parent5b2d35448899a128148c2614cb6203d8c5986de0 (diff)
downloadGradeBook-e1f40958894955957fa3c8d0c2039c087d14fec4.tar.gz
GradeBook-e1f40958894955957fa3c8d0c2039c087d14fec4.zip
delete column moved to low level table operation file
Ignore-this: d95aac67b1bc99c233bf8cada024b42c darcs-hash:20110416004050-067c0-5f30fb39f0d5eacd59db2befd7e45b83459ca451.gz
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl37
1 files changed, 1 insertions, 36 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index a8a959a..24df524 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -1453,44 +1453,9 @@ proc removeElementFromList { element2remove old_list } {
return $new_list
}
-proc colList2sqlColStr { col_list } {
- set sqlStr {}
- foreach col $col_list {
- if {$sqlStr ne ""} {
- set sqlStr $sqlStr,\"$col\"
- } else {
- set sqlStr \"$col\"
- }
- }
- return $sqlStr
-}
-
proc DeleteColumnNonWeb { columnname } {
- if { $columnname != "" } {
-
- # removing the column name to be deleted from total list
-
- set old_column_list [getColListFromTable GradesTable]
- set new_column_list [removeElementFromList $columnname $old_column_list]
- set sql_new_column_str [colList2sqlColStr $new_column_list]
- set eval_str "BEGIN TRANSACTION;
- CREATE TEMPORARY TABLE GradesTable_backup($sql_new_column_str);
- INSERT INTO GradesTable_backup SELECT $sql_new_column_str FROM GradesTable;
- DROP TABLE GradesTable;
- CREATE TABLE GradesTable($sql_new_column_str);
- INSERT INTO GradesTable SELECT $sql_new_column_str FROM GradesTable_backup;
- DROP TABLE GradesTable_backup;
- COMMIT;"
- set err [catch {db eval $eval_str } errStat]
- if { $err } {
- htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
- }
- } else {
- htmlErrorMsg "empty column names are not permitted"
-
- }
+ DeleteColumnFromTable GradesTable $columnname
calculteWeightedTotals
}