差分発生行の前後
無視リスト:
コミット日時:
2010/02/28 22:28:26 (14 年前)
コミッタ:
sorshi
ログメッセージ:

SQLite採用

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • trunk/install/perl/updatem2pfiletable.pl

    r83 r94  
    1616use DBI; 
    1717use DBD::Pg; 
     18use DBD::SQLite; 
    1819 
    1920$path = $0; 
    2021$path =~ s/updatem2pfiletable.pl$//i; 
    21 if ($pwd ne "./"){ 
     22if ($path ne "./"){ 
    2223push( @INC, "$path"); 
    2324} 
    2425 
    2526require "foltialib.pl"; 
    26         my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d", 
    27                 $DBDriv,$DBName,$DBHost,$DBPort); 
    28          $dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; 
     27$dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; 
    2928 
    3029$dbh->{AutoCommit} = 0; 
    3130# ひとまず消す 
    32 $query =  "DELETE  FROM  foltia_m2pfiles  "; 
    33          $sth = $dbh->prepare($query); 
     31$sth = $dbh->prepare($stmt{'updatem2pfiletable.1'}); 
    3432        $sth->execute(); 
    3533 
    3634while ($file = glob("$recfolderpath/*.m2?")) { 
    3735$file =~ s/$recfolderpath\///; 
    38 $query =  "insert into  foltia_m2pfiles values ('$file')"
    39 $oserr = $dbh->do($query); 
     36    $sth = $dbh->prepare($stmt{'updatem2pfiletable.2'})
     37    $sth->execute($file); 
    4038# print "$file\n"; 
    4139}#while 
     
    4644 
    4745# ひとまず消す 
    48 $query =  "DELETE  FROM  foltia_mp4files  "; 
    49          $sth = $dbh->prepare($query); 
     46$sth = $dbh->prepare($stmt{'updatem2pfiletable.3'}); 
    5047        $sth->execute(); 
    5148 
     
    5855$filetid =~ s/[^0-9]//g; 
    5956if (($filetid ne "" )&& ($fileline[2] ne "" )){ 
    60         $query =  "insert into  foltia_mp4files values ('$filetid','$fileline[2]')"
    61         $oserr = $dbh->do($query); 
     57        $sth = $dbh->prepare($stmt{'updatem2pfiletable.4'})
     58        $oserr = $sth->execute($filetid, $fileline[2]); 
    6259#print "$filetid;$fileline[2];$query\n" 
    6360# http://www.atmarkit.co.jp/fnetwork/rensai/sql03/sql1.html 
track feed