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 MapperTo 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 sqlalchemy+...@googlegroups.com.To post to this group, send email to sqlal...@googlegroups.com.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.
Unfortunately the Sybase dialect is not supported right now, but also I don't see anything obviously wrong with the query you have, except perhaps Sybase doesn't like that you have a table named "Users" that is using quoting; it is possible that it wants a different quoting character, not sure. Or perhaps you should be omitting the "dbo" schema, which should be the defaul schema in any case. Sorry I can't be of more help.On Fri, Jul 5, 2019, at 10:11 AM, Ishan Shah wrote:
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 MapperTo 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 sqlal...@googlegroups.com.
Thanks for the prompt reply!Since this page (https://docs.sqlalchemy.org/en/13/dialects/sybase.html) stated that Sybase is supported but there might be issues, I tried testing it. Do you mean to say that there is no support at all?
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.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/2883f032-fa61-40de-a13f-1fbe20b677a5%40googlegroups.com.