我在 tcl 中有以下代码..
proc GetPPVSummary {} {
global LIBRARY DB_MACHINE ALT_MACHINE
set query "SELECT first 2 * from test ORDER by ppv_id DESC"
set result [mtlrequest $LIBRARY DbSelect "test@$ALT_MACHINE|$query"]
return $result
}
set return_data [GetPPVSummary]
puts $return_data
以上返回的是这样的:
{{753 38 {2000-04-10 00:00:00} {2000-04-11 00:00:00} 3 HQAWR 56897 PPV B Event_04292012_teaser {} Event_04292012_teaser The_World_Doesnt_Care {$99.00} {$0.01}}
如何在 tcl 中一一打印值?
好的,所以我现在尝试了以下操作:
foreach record $return_data {
set event_date [lindex $record 1]
set attempts_cnt [lindex $record 2]
set success_cnt [lindex $record 3]
set fail_cnt [lindex $record 4]
}
puts $event_date
现在,我得到整行而不是第一个或第二个值..