sub secIsNew { # Given a PACE security ID, return 1 if that security is newly held, # 0 if that security is not newly held. use strict 'vars'; my($secId) = $_[0]; my($sth); # Statement handle my($count); # Count returned by SQL select statements my($sql) = "select count(*) from analytics.an_security where security_id = :1 and is_new = 'Y'"; $sth = $dbh->prepare($sql); $sth->bind_param(1, $secId); $sth->execute(); ($count) = $sth->fetchrow_array; return $count; }