Hi!

thank you for your quick reply.

Scanning is a problem - most of my queries have more than 4000
characters (just counted them),
and their not formated in anyway in the output of the exception.
Usually I try to remember the queries that I most recently changed or
added.
But reading the select statement in a time efficient manner is for me
impossible.
The only way for me to understand the select statement is reading the
sqlalchemy python that
constructs the statement - which unfortunately doesn't help me with
missing aliases or so.

Thanks,
Jan-Eric Duden

On May 15, 4:50 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> On May 15, 4:37 am, Jan-Eric <jedu...@gmail.com> wrote:
>
> > Hi!
>
> > what approaches do you guys use to find syntax errors in very large
> > sql statements.
>
> > Usually, I build my statements joining several sqlalchemy select
> > statements together to a single statement.
> > It works great until if I make a (small) mistake (like forgetting an
> > alias or other things ) , the exception that is raised in these cases
> > is not helpful.
> > For example, I might get "Not an executable clause: " error and then
> > the complete 30+ lines plus sql statement.
> > This approach is ok for small sql statements, but I really would like
> > to know exactly the spot where the error occurs.
>
> "not an executable clause" is easy, it only refers to the actual thing
> you passed to execute().   It has to be a select(), update(),
> insert(), etc.  I.e. you can't pass a table column or other fragment
> to execute().   An alias() is fine for execute() as well (at least it
> should be).   There's no need to dig into 30 lines of anything for
> that, it occurred right at the top level.
>
> Otherwise, the SQL expression language narrows down the possible set
> of "syntax" to something very small - typos and incorrect names and
> such aren't really possible.   The "alias missing" is one common
> error, just look at the SQL for any pattern of (select ...) without an
> AS following the last parenthesis.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to