SQL error 170 using Win32::ODBC 
Author Message
 SQL error 170 using Win32::ODBC

Using Win32::ODBC I'm trying to execute a simple SQL statement on an
existing table and get a 170 error that I am having trouble resolving
(see below). Not sure what the error is to fix it.

Thanks in advance!

I connect to the DSN without problems and I know the table exists
because I can retrieve the table names, as thus:



        print "$TableList[$i]\n";
    }

    $SqlStatement = 'SELECT?*?FROM?CallSummary';

    if($Data->Sql($SqlStatement)){
        $Data->DumpError;
    }

This is the error I get:
---------- Error Report: ----------
Errors for "10" on connection 1:
Connection Number: 1
Error number: 170
Error message: "[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:
Incorrect syntax near ''."
-----------------------------------



Wed, 06 Apr 2005 05:04:34 GMT  
 SQL error 170 using Win32::ODBC
Quote:

> Using Win32::ODBC I'm trying to execute a simple SQL statement on an
> existing table and get a 170 error that I am having trouble resolving
> (see below). Not sure what the error is to fix it.

> Thanks in advance!

> I connect to the DSN without problems and I know the table exists
> because I can retrieve the table names, as thus:



>         print "$TableList[$i]\n";
>     }

>     $SqlStatement = 'SELECT * FROM CallSummary';

>     if($Data->Sql($SqlStatement)){
>         $Data->DumpError;
>     }

> This is the error I get:
> ---------- Error Report: ----------
> Errors for "10" on connection 1:
> Connection Number: 1
> Error number: 170
> Error message: "[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:
> Incorrect syntax near ''."
> -----------------------------------

On Dave Roth's Win32::ODB FAQ page (http://www.roth.net/perl/odbc/faq/),
the examples show the query in double-quotes ("SELECT * FROM
CalSummary").  I can't imagine why this would matter, but give it a
shot.
--
Ron Reidy
Oracle DBA


Wed, 06 Apr 2005 14:08:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Win32::ODBC SQL error

2. LONG: Req: Help in retrieving values from SQL Server stored procedure using Win32::ODBC

3. looping through an sql query using win32::odbc

4. looping through an sql query using win32::odbc

5. Win32::ODBC SQL and using date

6. Win32::ODBC, Perl SQL vs. standard SQL

7. Help: undefined subroutine error using Win32::ODBC

8. Multiple ODBC Error Messages and Win32::ODBC

9. DBI, DBD:ODBC error with MS SQL Server 6.5

10. Q: Can't connect to SQL data source name via Win32::ODBC API

11. Win32:ODBC and Microsoft's SQL Server 6.5

12. SQL Pass-thru query with Win32::ODBC?

 

 
Powered by phpBB® Forum Software