aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 } {