hallikpapa has asked for the wisdom of the Perl Monks concerning the following question:
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|);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI::ODBC Stored Procedure execution
by Narveson (Chaplain) on Jan 27, 2008 at 19:28 UTC | |
by hallikpapa (Scribe) on Jan 27, 2008 at 19:40 UTC | |
by john_oshea (Priest) on Jan 28, 2008 at 13:20 UTC | |
|
Re: DBI::ODBC Stored Procedure execution
by olus (Curate) on Jan 27, 2008 at 23:06 UTC |