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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.