I have to write this code in tcl and I am really frustrated because This is my first time in tcl. I need to display something like this:
I am using tcl/informix and I am struggling a bit as how to achieve the above. Here is a pseudocode I wrote
select event_date,attempts_cnt,success_cnt,fail_cnt from cc_web_ppv_counts WHERE
event_id='123'
{
get $sd_attempt_cnt
get $sd_success_cnt
get $sd_fail_cnt
get event_date
select event_date,attempts_cnt,success_cnt,fail_cnt from cc_web_ppv_counts WHERE
event_id='125'
{
get $hd_attempt_cnt
get $hd_success_cnt
get $hd_fail_cnt
$total_attempts=$sd_attempt_cnt + $hd_attempt_cnt;
$total_success=$sd_success_cnt + $hd_success_cnt;
$total_fail=$total_attempts -$total_success;
$success_rate=($total_success/$total_attempts)*100;
$hd_success_rate=($hd_success_cnt/total_success)*100;
$sd_success_rate=($sd_success_cnt/total_success)*100;
}
}
Note There for each event_date(for example today) there would be only 2 records.for sd and hd respectively.so the dates have to be displayed dynamically in the output.
I would appreciate if somone could point out to some examples in tcl that pulls data and displays like above.
Probably tclodbc with a proper ODBC driver is a way to go.
As to the second part of the question, the answer heavily depends on how do you define “display”.