See below.
>
>
> Hi,
>
> I am using Perl with DBD-ODBC to extract live values from an Wonderware
> Industrial SQL which runs on top of a Microsoft SQL Server.
>
> The platform is Windows NT 4.0, Microsoft SQL Server 6.50.193 and
> Industrial
> SQL version 7.0.211, Microsoft SQL Server ODBC version 3.70.0961.
>
> When I use:
> DBI prepare - SQLPrepare
> DBI execute - SQLExecute
> DBI fetchrow - SQLFetch
> to select the live data from the Industrial SQL it returns no rows.
> This is due to the fact that only the SQLExecDirect ODBC function
> will cause
> Industrial SQL to access and provide the live data.
>
> When using Microsoft MDAC ODBC Test the data are provided with no
> problems.
>
> In other words I need to make DBI use the ExecDirect ODBC function.
>
> Can I do this in a way that will allow me to use the DBI fetchrow to read
> the data?
>
> I have read in a release note for DBD-ODBC 0.35 that $dbh->func( $stmt,
> ExecDirect) can be used to call ExecDirect, but will this allow me to read
> the data afterwards?
No, it won't, but it could... It kills the statement handle as it was
designed to help make the "do()" functionality use the ExecDirect. The
quickest way of handling it, would be to:
- ExecDirect returns an sth instead of the row count
- do() with no params calls ExecDirect (as it does now) then calls
$sth->rows and finishes the handle
- That would leave ExecDirect available for your purpose.
I can't say that I'll be able to get to it soon. There are a few bug fixes
in the queue. Patches welcome!
Regards,
Jeff