RE: SQL problem

2005-11-28 Thread Steven Manross
Your prepare cannot be a multi-statement operation... And should be like so.. if (!($sth1 = $dbh->prepare('exec spsomeproc_or_sqlstatement ?,?,?'))) { print "Failed preparing sql call\n".$dbh->errstr."\n"; return 0; } Or in your example... $MinsUsedInRangeQuery1 = $DBH->prepare(

Re: SQL problem

2005-11-24 Thread Trevor Joerges
### when program starts $MinsUsedInRangeQuery1 = $DBH->prepare('DECLARE @StartRange datetime, @EndRange datetime' . ' SET @StartRange = ?, @EndRange = ?' . ' SELECT SUM(DATEDIFF(mi,StartTime,EndTime))' . ' AS MinsUsed FROM Sessions' . ' WHERE AuthSource = ? AND UserID = ?' . ' A

Re: SQL-Problem - UPPER()

2001-01-24 Thread Joseph Youngquist
Hey Johannes, I've bumped into similar issues with the 'Prepare' statement in PERL with mySQL. I've started to use the 'Do($statement)' insted. Try: $Statement = "SELECT * FROM gbook WHERE notes LIKE '%$in{'searchValue'}%' OR keywords LIKE '%$in{'searchValue'}%' "