Index: /trunk/install/perl/db/Pg.pl =================================================================== --- /trunk/install/perl/db/Pg.pl (リビジョン 113) +++ /trunk/install/perl/db/Pg.pl (リビジョン 121) @@ -73,5 +73,5 @@ 'updatem2pfiletable.4' => "INSERT into foltia_mp4files values (?, ?)", -'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ?", +'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?", 'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?", 'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" , @@ -79,6 +79,6 @@ 'epgimport.2' => "SELECT digitalch,ontvcode FROM foltia_station WHERE stationid = ?" , 'epgimport.3' => "SELECT digitalch,ontvcode FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 13 AND digitalch <= 62 ORDER BY digitalch ASC" , -'epgimport.4' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 100 AND digitalch <= 222 ORDER BY digitalch ASC" , -'epgimport.5' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 223 ORDER BY digitalch ASC" , +'epgimport.4' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 100 AND digitalch <= 222" , +'epgimport.5' => "SELECT count(*) FROM foltia_station WHERE ontvcode is not NULL AND digitalch >= 223" , 'epgimport.6' => "SELECT foltia_program.tid, stationname, foltia_program.title, Index: /trunk/install/perl/xmltv2foltia.pl =================================================================== --- /trunk/install/perl/xmltv2foltia.pl (リビジョン 120) +++ /trunk/install/perl/xmltv2foltia.pl (リビジョン 121) @@ -16,10 +16,10 @@ # -use LWP::Simple; +#use LWP::Simple; #use Encode qw(from_to); #use encoding 'euc-jp', STDIN=>'utf8', STDOUT=>'euc-jp' ; # 標準入力:utf8 # http://www.lr.pi.titech.ac.jp/~abekawa/perl/perl_unicode.html use Jcode; -use Data::Dumper; +#use Data::Dumper; use Time::Local; use DBI; @@ -224,7 +224,6 @@ $foltiaendtime = substr($foltiaendtime,0,12); # 12桁 200508072355 -#$sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.1'}); +$sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.1'}); my $now = &epoch2foldate(time()); -$sth = $dbh->prepare( "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?"); $sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel,$now); @@ -281,5 +280,4 @@ sub commitdb{ $dbh->{AutoCommit} = 0; -$dbh->do('BEGIN'); #print Dumper(\@dbarray); my $loopcount = @foltiastarttime; @@ -298,5 +296,5 @@ #&writelog("xmltv2foltia DEBUG : INSERT INTO foltia_epg VALUES ( NULL , $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i])"); }# end for -$dbh->do('COMMIT'); +$dbh->commit; $dbh->{AutoCommit} = 1; }#end sub commitdb