It's super-easy Richard.  You can provide a list of Field objects or a list 
of colnames in "table.field" format and it will return a Rows object for 
you.  It's almost too easy!

rows=db.executesql("select id,code,name from lsc",
                    colnames=['lsc.id','lsc.code','lsc.name'])


-- Joe

On Tuesday, May 20, 2014 7:26:24 AM UTC-7, Richard wrote:
>
> Yes you are right... I just puch as far as I can for this one to touch the 
> limit... Though the reason was to make use of Row and dot notation to 
> access data because I manipulate them a lot and using slicing would make my 
> code much less redable.
>
> I think there is a way to initialise Row on db.executesql, I will have 
> read about that.
>
> Thanks
>
> Richard
>
>
> On Fri, May 16, 2014 at 9:42 PM, Joe Barnhart 
> <joe.ba...@gmail.com<javascript:>
> > wrote:
>
>> Hi Richard --
>>
>> When using special DB features, sometimes it's best just to fall back to 
>> the old "executesql" function.  It works really well for those complex 
>> joins and special functions that are just too seldom-used to be 
>> special-cased in the DAL.
>>
>> In fact, when I was forced to use it not long ago, I was amazed at how 
>> simple and direct it was.  It really made a messy query into a clean one.
>>
>> -- Joe
>>
>>
>> On Wednesday, May 14, 2014 7:46:20 AM UTC-7, Richard wrote:
>>>
>>> Hello,
>>>
>>> Is there a way to do string_agg() with in web2py for a query that have 
>>> groupby clause?
>>>
>>> Richard
>>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to