チェンジセット 121: trunk/install/perl
- コミット日時:
- 2010/10/04 21:05:24 (14 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/db/Pg.pl
r113 r121 73 73 'updatem2pfiletable.4' => "INSERT into foltia_mp4files values (?, ?)", 74 74 75 'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? ",75 'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?", 76 76 'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?", 77 77 'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" , … … 79 79 'epgimport.2' => "SELECT digitalch,ontvcode FROM foltia_station WHERE stationid = ?" , 80 80 'epgimport.3' => "SELECT digitalch,ontvcode FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 13 AND digitalch <= 62 ORDER BY digitalch ASC" , 81 'epgimport.4' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 100 AND digitalch <= 222 ORDER BY digitalch ASC" ,82 'epgimport.5' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 223 ORDER BY digitalch ASC" ,81 'epgimport.4' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 100 AND digitalch <= 222" , 82 'epgimport.5' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 223" , 83 83 'epgimport.6' => "SELECT 84 84 foltia_program.tid, stationname, foltia_program.title, trunk/install/perl/xmltv2foltia.pl
r120 r121 16 16 # 17 17 18 use LWP::Simple;18 #use LWP::Simple; 19 19 #use Encode qw(from_to); 20 20 #use encoding 'euc-jp', STDIN=>'utf8', STDOUT=>'euc-jp' ; # 標準入力:utf8 21 21 # http://www.lr.pi.titech.ac.jp/~abekawa/perl/perl_unicode.html 22 22 use Jcode; 23 use Data::Dumper;23 #use Data::Dumper; 24 24 use Time::Local; 25 25 use DBI; … … 224 224 $foltiaendtime = substr($foltiaendtime,0,12); # 12桁 200508072355 225 225 226 #$sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.1'});226 $sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.1'}); 227 227 my $now = &epoch2foldate(time()); 228 $sth = $dbh->prepare( "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?");229 228 $sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel,$now); 230 229 … … 281 280 sub commitdb{ 282 281 $dbh->{AutoCommit} = 0; 283 $dbh->do('BEGIN');284 282 #print Dumper(\@dbarray); 285 283 my $loopcount = @foltiastarttime; … … 298 296 #&writelog("xmltv2foltia DEBUG : INSERT INTO foltia_epg VALUES ( NULL , $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i])"); 299 297 }# end for 300 $dbh-> do('COMMIT');298 $dbh->commit; 301 299 $dbh->{AutoCommit} = 1; 302 300 }#end sub commitdb