Jump to content

tcl display data from a query one by one


Recommended Posts

Anybody familar with tcl ?

I have a select query that returns an out put like

 

{HD 208 {} 2012-04-13 25 21 4} {SD 208 {} 2012-04-13 100 97 3} {HD 2072 {} 2012-04-13 5 4 1} {SD 2072 {} 2012-04-13 50 45 6}

Now I want to set to store them in a variable and display one by one so that i can display it using html tables

the records are returned in $get_record.

So here's what i am doing

 

foreach record $get_record {
    foreach item [lindex $record 0] {

	set event_name [ lindex $item 0]
	puts $event_name
	set event_date [ lindex $item 1]
	put $event_date
	set attempts_cnt [ lindex $item 2]
	put $attempts_cnt
	set success_cnt [ lindex $item 3]
	put $success_cnt

  }
}
  

Unfortunately this doesnt work..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.