diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2013-12-04 16:21:17 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2013-12-04 16:21:17 -0500 |
commit | 2b8795832d4a85fc5264353dd0ede8a6229b72fa (patch) | |
tree | facbe6df5988f891fde78f8eb6f4428d02b804cc | |
parent | 9ab8c9ec4c763d950bf166ec0646d2bff096c342 (diff) | |
download | GradeBook-2b8795832d4a85fc5264353dd0ede8a6229b72fa.tar.gz GradeBook-2b8795832d4a85fc5264353dd0ede8a6229b72fa.zip |
Update column function now calls rename column specificly
-rwxr-xr-x | GradeBook_lib.tcl | 19 |
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 } { |