It doesn't like the date I am passing shown here:#execute stored procedure my $sp = $msdbh->prepare(qq|usp_Dashboard_CallType \@start = 20080101| +); $sp->execute or die("$sp->errstr");
I have two questions about this: 1) How can I pass the variables properly in the format the SQL server wants, and 2) I need to execute this stored procedure for every date starting from the beginning of the year up until yesterday. I am assuming I need to loop through the an array somehow, maybe put this and the other stored procedure executions I need to do into a subroutine and pass each date one by one to the sub, while converting it properly to the SQL datetime? I am also looking into the fact there may be a problem with what the SQL server is doing as far as conversion. But regardless, Is this correct if I want to loop thru dates in a subroutine?DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver][SQL +Server]Error converting data type int to datetime.
my $sp = $msdbh->prepare(qq|usp_Dashboard_CallType \@start = $next_dat +e|);
In reply to DBI::ODBC Stored Procedure execution by hallikpapa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |