in reply to execute failed: called with 2 bind variables when 0 are needed

In addition to Corion's response, I would mention that if you DO you want to give $sth->execute() parameters, they need to be question marks in your query itself.. like
my $variable = "E"; my $sql = 'SELECT crcp_cod_grupo, crcp_cod_prato FROM REST.dbo.CRCP_PR ATO WHERE crcp_cod_grupo = ?'; my $sth = $dbh->prepare($sql); $sth->execute($variable);
You would then list each variable in the order you have them as question marks in your query
Also, I normally put the query in double quotes instead of single quotes..
UPDATE: Are you trying to execute only the rows that you are incorrectly passing as parameters to execute?
  • Comment on Re: execute failed: called with 2 bind variables when 0 are needed
  • Download Code