diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-04-15 18:39:20 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-04-15 18:39:20 -0400 |
commit | cb78005bcae1d81b57f5506e03625d4db414edb8 (patch) | |
tree | 44ecb92300d1f68f8e61c7ef6ce387d27fe8a2d1 | |
parent | 5b811426160684adce4c8757b2264fd8999c0720 (diff) | |
download | GradeBook-cb78005bcae1d81b57f5506e03625d4db414edb8.tar.gz GradeBook-cb78005bcae1d81b57f5506e03625d4db414edb8.zip |
proc moved to the file begining
Ignore-this: 29e3107ff58494238d224de10e314d10
darcs-hash:20110415223920-067c0-0870e12e3e25204da1fed51a65286e31545cd380.gz
-rwxr-xr-x | GradeBook_lib.tcl | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 0b91928..a101eca 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -89,6 +89,24 @@ proc getColListFromTable {table} { return $all_column_names } +proc SelectColvalueFromTable { table column_of_interest col row_value } { + # select value of 'column_of_interest' from 'table' where 'col'='row_value' + set value {} + set eval_str "SELECT \"$column_of_interest\" FROM \'$table\' WHERE \"$col\"=\"$row_value\"" + set err [catch { + db eval $eval_str v { + set value $v($column_of_interest) + } + } errStat ] + if { $err } { + set msg_text "the following error happen in proc SelectColvalueFromTable while selecting from table $table $errStat" + htmlErrorMsg $msg_text + dbg $msg_text 3 + set $value {} + } + return $value +} + proc doesColumnExists {col table} { if { $col in [getColListFromTable $table] } { return true; @@ -827,23 +845,6 @@ proc htmlFooter {permission_list} { puts "</div>" } -proc SelectColvalueFromTable { table column_of_interest col row_value } { - # select value of 'column_of_interest' from 'table' where 'col'='row_value' - set value {} - set eval_str "SELECT \"$column_of_interest\" FROM \'$table\' WHERE \"$col\"=\"$row_value\"" - set err [catch { - db eval $eval_str v { - set value $v($column_of_interest) - } - } errStat ] - if { $err } { - set msg_text "the following error happen in proc SelectColvalueFromTable while selecting from table $table $errStat" - htmlErrorMsg $msg_text - dbg $msg_text 3 - set $value {} - } - return $value -} proc SelectColValue4User { colname user } { return [SelectColvalueFromTable GradesTable $colname UserName $user] |