Hi Douglas,
 
year is part of the properties of class which has this block of code and it
does have a value, there is actualy no need to for me to have it as a
placeholder since it wouldn't change in the life span of the instance of
this class that why I didn't go into trouble of making it a placeholder.
I've double checked it does have a value just like $trg_id, turning on
RaiseError doesn't make any difference.
 
Thank you,
 
Anton

 -----Original Message-----
From: Wilson, Doug [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 4:09 PM
To: 'Kokarski, Anton'; [EMAIL PROTECTED]
Subject: RE: problems with prepared and bind_param




> From: Kokarski, Anton [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ] 
> 
> my $statement = "select count(*) as viewable from pf_funding where ". 
>                    "target_id = ? and amt_allocated > 0.01 
> and year = '" . 
> $self->{year} . "'"; 
> 

Is year always the same value or does it only change once a year? I'd 
probably make it a placeholder also either way... 

>    if (! defined($sth)) { 
>      $sth = $dbh->prepare($statement); 
>    } 

Do you have RaiseError set?? If there's a prepare error, will you 
catch it? 

> 
>    $sth->bind_param(1, $trg_id); 

> Am at the end of the line here folks and running out of 
> ideas, i even tried 
> to do trace but that didn't give me any bigger insight on 
> what is happening 
> here. 

Assuming RaiseError is on, make sure what's in $trg_id and $self->{year} 
is what you think it is (including whitespace). 
I've seen cases where newlines in the data caused 
differences in results when converting to placeholders. 

HTH, 
Douglas Wilson 

Reply via email to