Valid SQL Statement doesn't work in DBI::ODBC 
Author Message
 Valid SQL Statement doesn't work in DBI::ODBC

The following SQL statement works when executing it in the Microsoft
Management Console for SQL Server 7, but when I try to execute it in
Perl it doesn't work.  Here's the SQL...

SELECT Client.FirstName, Client.LastName, Client.AddressLine1,
    City.Description AS CityName, City.PostCode,
    State.Description AS StateName,
    Ethnicity.Description AS EthnicName,
    AgeGroup.Description AS AgeGroupName,
    Gender.Description AS GenderName
FROM Client
    INNER JOIN City ON Client.CityID = City.CityID
    INNER JOIN State ON City.StateID = State.StateID
    INNER JOIN AgeGroup ON Client.AgeGroupID = AgeGroup.AgeGroupID
    INNER JOIN Ethnicity ON Client.EthnicityID = Ethnicity.EthnicityID
    INNER JOIN Gender ON Client.GenderID = Gender.GenderID
WHERE (Client.LastName LIKE 'Smith%')

In SQL Server 7 I get a list of all the Smith's in my database, but in
Perl, the statement handle returns undef.  Does anyone know if there's
anything wrong with the syntax or if the DBI::ODBC driver can't handle
JOIN's for some silly reason?

Thanks heaps.

==================================================================
Phone:  02 6766 1546 (Australia)

ICQ:    13045454



Wed, 08 May 2002 03:00:00 GMT  
 Valid SQL Statement doesn't work in DBI::ODBC

Quote:
>In SQL Server 7 I get a list of all the Smith's in my database, but in
>Perl, the statement handle returns undef.  Does anyone know if there's
>anything wrong with the syntax or if the DBI::ODBC driver can't handle
>JOIN's for some silly reason?

It would help if you posted the Perl code in question.

--
Brett W. McCoy          
                                        http://www.lan2wan.com/~bmccoy/
-----------------------------------------------------------------------
Most people can do without the essentials, but not without the luxuries.



Wed, 08 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ODBC.PM and sql's Like doesn't work

2. if statement doesn't work!

3. Help - Location directive doesn't work after select statement

4. DBD::Oracle PL/SQL statement emulating a SQL statement

5. Win32::ODBC; NEW doesn't work

6. (new Win32::ODBC($DSN1)) doesn't work

7. WIN32::ODBC new() doesn't work

8. MS Access, Linux, DBI, DBD::ODBC, Easysoft's ODBC-ODBC Bridge

9. DBI dbiproxy and ODBC connection isn't working

10. SQL statements and ODBC

11. Perl5 Win32::ODBC SQL Statement Involing dates

12. DBD::ODBC::db prepare failed: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'tblClient'. (SQL-S0002)

 

 
Powered by phpBB® Forum Software