I am using the Sybase dialect and trying to read an existing table. After 
loading the users table as follows, I use the query function to print all the 
records but I am getting a programming error which is related to pyodbc. My 
guess is that there is a syntax error here. How do I overcome this? Kindly 
advise.


users = Table("Users", metadata, autoload=True, autoload_with=engine, 
schema='dbo')

session.query(users).all()


ProgrammingError: (pyodbc.ProgrammingError) ('42000', "[42000] [FreeTDS][SQL 
Server]Incorrect syntax near 'dbo.Users.'.\n (102) (SQLExecDirectW)")

[SQL: SELECT dbo."Users".user_id AS "dbo_Users_user_id", dbo."Users".windows_id 
AS "dbo_Users_windows_id", dbo."Users".first_name AS "dbo_Users_first_name", 
dbo."Users".last_name AS "dbo_Users_last_name", dbo."Users".user_type AS 
"dbo_Users_user_type", dbo."Users".domain AS "dbo_Users_domain", 
dbo."Users".active AS "dbo_Users_active"
FROM dbo."Users"]

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/d8379326-87b8-43cf-aace-fe94f7926ebe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to