#!/usr/bin/perl use DBI; my $dsn = 'DBI:mysql::'; my $db_user_name = ''; my $db_password = ''; my ($id, $password); my $dbh = DBI->connect($dsn, $db_user_name, $db_password); my $sth = $dbh->prepare(qq{ select max(queueid) from queue_actions where nodename = '' }); $sth->execute(); ($maxid) = $sth->fetchrow_array(); $sth->finish(); open (QLOGF, "<$ARGV[0]"); while ($qlogstr = ) { chop($qlogstr); @bdownstr = split(/\|/, $qlogstr, 7); if ($bdownstr[0] > $maxid) { if ($bdownstr[4] eq "ABANDON") { ($pos, $holdtime) = split(/\|/, $bdownstr[6]); $bdownstr[6] = $holdtime; } $sqlstr = qq|insert into queue_actions (queueid, uniqueid, queuename, agentname, action, alt1 , alt2, userfield, calltype, nodename) values ($bdownstr[0], '$bdownstr[1]', '$bdownstr[2]', '$bdownstr[3]', '$bdownstr[4]', '$bdownstr[5]', '$bdownstr[6]', '', null, '')|; $dbh->do($sqlstr); } } close (QLOGF); $dbh->disconnect();