[sqlalchemy] Re: Using substring function

2008-04-11 Thread maxi


 (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.


Oopss, sorry, I respond to myself.

The problem is with substring function, in SQL (I'm using Firebird
2.x) substring funcition sintax is:

SUBSTRING(planilladet.msg_debug 1 FROM 40)

How can do it in sqlalchemy ? (I use sqlalchemy 0.3.11)









--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: Using substring function

2008-04-11 Thread Lele Gaifax

On Fri, 11 Apr 2008 07:00:42 -0700 (PDT)
maxi [EMAIL PROTECTED] wrote:

 The problem is with substring function, in SQL (I'm using Firebird
 2.x) substring funcition sintax is:
 
 SUBSTRING(planilladet.msg_debug 1 FROM 40)
 
 How can do it in sqlalchemy ? (I use sqlalchemy 0.3.11)

It's been fairly easy to implement it for 0.4.x, see revision 4490:
dunno about 0.3.x but it shouldn't be any harder.

ciao, lele.
-- 
nickname: Lele Gaifax| Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas| comincerò ad aver paura di chi mi copia.
[EMAIL PROTECTED] | -- Fortunato Depero, 1929.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---