2011-08-31 21:47:43 +00:00
|
|
|
|
2011-09-03 23:26:54 +00:00
|
|
|
if {![exists -proc get_channel_attr]} {
|
2013-10-26 11:05:47 +00:00
|
|
|
if {![exists -proc rsv]} { require rsv.class }
|
2011-08-31 21:47:43 +00:00
|
|
|
|
2011-09-03 23:26:54 +00:00
|
|
|
proc get_channel_attr {channel {field hSvc}} {
|
2011-08-31 21:47:43 +00:00
|
|
|
global rsvdb
|
|
|
|
|
2011-09-03 23:26:54 +00:00
|
|
|
set ff [$rsvdb query "
|
|
|
|
select $field
|
2011-08-31 21:47:43 +00:00
|
|
|
from channel.TBL_SVC
|
|
|
|
where szSvcName = '$channel'
|
|
|
|
or szSvcname = '\025$channel'
|
|
|
|
limit 1
|
|
|
|
"]
|
|
|
|
|
2011-09-03 23:26:54 +00:00
|
|
|
if {[llength $ff] == 1} {
|
|
|
|
return [lindex [lindex $ff 0] 1]
|
2011-08-31 21:47:43 +00:00
|
|
|
}
|
2011-09-03 23:26:54 +00:00
|
|
|
return ""
|
2011-08-31 21:47:43 +00:00
|
|
|
}
|
|
|
|
|
2011-09-03 23:26:54 +00:00
|
|
|
proc get_channel_attr_bylcn {lcn {field hSvc}} {
|
2011-08-31 21:47:43 +00:00
|
|
|
global rsvdb
|
|
|
|
|
2011-09-03 23:26:54 +00:00
|
|
|
set ff [$rsvdb query "
|
|
|
|
select $field
|
2011-08-31 21:47:43 +00:00
|
|
|
from channel.TBL_SVC
|
|
|
|
where usLcn = $lcn
|
|
|
|
limit 1
|
|
|
|
"]
|
|
|
|
|
2011-09-03 23:26:54 +00:00
|
|
|
if {[llength $ff] == 1} {
|
|
|
|
return [lindex [lindex $ff 0] 1]
|
2011-08-31 21:47:43 +00:00
|
|
|
}
|
2011-09-03 23:26:54 +00:00
|
|
|
return 0
|
2011-08-31 21:47:43 +00:00
|
|
|
}
|
2012-04-18 20:26:34 +00:00
|
|
|
|
2012-07-21 19:47:23 +00:00
|
|
|
proc get_channel_attr_byorglcn {lcn {field hSvc}} {
|
|
|
|
global rsvdb
|
|
|
|
|
|
|
|
set ff [$rsvdb query "
|
|
|
|
select $field
|
|
|
|
from channel.TBL_SVC
|
|
|
|
where usOrgLcn = $lcn
|
|
|
|
and usLcn < 800
|
|
|
|
limit 1
|
|
|
|
"]
|
|
|
|
|
|
|
|
if {[llength $ff] == 1} {
|
|
|
|
return [lindex [lindex $ff 0] 1]
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2012-04-18 20:26:34 +00:00
|
|
|
proc get_channel_attr_byhsvc {hsvc {field usLcn}} {
|
|
|
|
global rsvdb
|
|
|
|
|
|
|
|
set ff [$rsvdb query "
|
|
|
|
select $field
|
|
|
|
from channel.TBL_SVC
|
|
|
|
where hSvc = $hsvc
|
|
|
|
limit 1
|
|
|
|
"]
|
|
|
|
|
|
|
|
if {[llength $ff] == 1} {
|
|
|
|
return [lindex [lindex $ff 0] 1]
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
2011-08-31 21:47:43 +00:00
|
|
|
}
|
|
|
|
|