aboutsummaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2013-12-04 16:21:17 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2013-12-04 16:21:17 -0500
commit2b8795832d4a85fc5264353dd0ede8a6229b72fa (patch)
treefacbe6df5988f891fde78f8eb6f4428d02b804cc /GradeBook_lib.tcl
parent9ab8c9ec4c763d950bf166ec0646d2bff096c342 (diff)
downloadGradeBook-2b8795832d4a85fc5264353dd0ede8a6229b72fa.tar.gz
GradeBook-2b8795832d4a85fc5264353dd0ede8a6229b72fa.zip
Update column function now calls rename column specificly
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl19
1 files changed, 2 insertions, 17 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index fc5cce3..b01ce5e 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -1530,23 +1530,8 @@ proc UpdateColumn { permission_list user } {
htmlErrorMsg "empty column names are not permitted"
return
}
- set eval_str [concat SELECT * FROM GradesTable ]
- set err [catch {db eval $eval_str v {} } errStat]
- set old_column_list $v(*)
- # check if column with the suggested new name is already exist
- foreach cname $old_column_list {
- if { $cname eq $newcolumnname } {
- htmlErrorMsg "The column name <b>$newcolumnname</b> is already exist"
- return
- }
- }
- # sqlite does not allow rename columns
- # I will first create new column identical to the old one
- AddColumnNonWeb $newcolumnname $column_category $maxpointpossible
- set sql_str [concat UPDATE GradesTable SET \"$newcolumnname\"=\"$oldcolumnname\"]
- set err [catch {db eval $sql_str } errStat]
- # then delete the old one
- DeleteColumnNonWeb $oldcolumnname
+
+ RenameColumnNonWeb $oldcolumnname $newcolumnname
}
proc UpdateColValue4UserNameNonWeb { columnname username val } {