Hi,
I need to use substring function into sql statement. For it, I define
the next sql:

_sql = select([func.substring(planilladet.c.msg_debug, 1,
40).label('msg_debug'), func.sum(planilladet.c.cant).label('cant'),
func.sum(planilladet.c.cant * planilladet.c.importe).label('importe')],
\
                     from_obj=[planilladet.join(planilla)],
group_by=[1])

When I execute that sql, this error message appear:
(ProgrammingError) (-104, 'isc_dsql_prepare: \n  Dynamic SQL Error\n
SQL error code = -104\n  Token unknown - line 1, column 39\n  ,')
'SELECT substring(planilladet.msg_debug, ?, ?) AS msg_debug,
sum(planilladet.cant) AS cant, sum(planilladet.cant *
planilladet.importe) AS importe \nFROM planilladet JOIN planilla ON
planilla.plan_id = planilladet.plan_id \nWHERE planilla.conv_id = ?
AND planilla.fec_imput = ? GROUP BY 1' [1, 40, 1, datetime.date(2008,
2, 1)]

What can be the problem here?

Thanks in advance.


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

Reply via email to