#!/usr/bin/perl -w # # Boiler-plate-ish database pattern use strict; use DBI; my $dbh = DBI->connect("DBI:Pg:dbname=mydatabase",'','') or die $DBD::errstr; my $sth = $dbh->prepare( qq( SELECT Count(*) as x from e_annotation_090812.annotation A WHERE A.user IN (SELECT T.Line FROM europhenome_annotation_090812.Temp_table T) AND entity_name LIKE '%' AND evidence_code NOT LIKE ? AND A.centre LIKE ? ) ) or die $dbh->errstr; # Handwaving $ev_code and $pattern2 $sth->execute ("%" . $ev_code,"%" . $pattern2); my ($count) = $sth->fetchrow_array();