Hi All,

I want to query the database log of SQL Server using DBI:ODBC and I
encounter a problem.

I want to use "select * from ::fn_dblog(null,null)" to query the log, but
DBI takes :: as placeholder and fails. As follows,

         use DBI;

         my $dbh = DBI->connect("dbi:ODBC:MyDSN")

                  or die "Can't connect: $DBI::errstr\n";

         my $query = qq{

                                            select * from
::fn_dblog(null,null)

                            };

         my $sth = $dbh->prepare($query) ;  

         $sth->execute( ) or die $dbh->errstr;

I run the script and the output is:

Can't rebind placeholder fn_dblog at F:\zDataBase\db.pl line 29.

 

How to fix it ?

Best regards!

Thomas Yan

Reply via email to