On Jul 20, 2010, at 4:44 PM, Lukasz Szybalski wrote:

> 
>> Session.execute() accepts strings that are converted to text():
>> 
>> a=session.execute("assp_ReportDailyTransactions 
>> @start_date=:start,@end_date=:end", 
>> params={'start':"20100701",'end':"20100719"})
> 
> Thanks,
> That does work.
> 
> Is it possible to get each record to be returned as object instead of
> dictionary or change it so that it is similar object
> as ..session.query(....).all()?

sure, query.from_statement(), its in the ORM tutorial....




> 
> I need to pass in the objects a[5] or do
> 
> a=session.execute("assp_ReportDailyTransactions
> @start_date=:start,@end_date=:end",
> params={'start':"20100701",'end':"20100719"})
> new_record=a[5]
> 
> print new_record.customername
> #call a function by passing the object
> process_client(new_record)
> #the process_client function can access records like
> new_record.clientname,new_record.transaction_date
> 
> right now I get:
> a[5]
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> TypeError: 'ResultProxy' object is unindexable
> 
> Do I convert the return or I use a different command?
> 
> Thanks,
> Lucas
> 
> -- 
> 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.
> 

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