On Sunday, September 27, 2015 at 2:49:33 PM UTC-7, lfestevao wrote:
>
> Hy there, I have a query ready and works alright with executesql.
> I'm trying to change queries to use the dal but there's a problem in this 
> case.
>

What's your goal in switching from executesql() to using the dal?
 

>
> I have 2 tables related only by entry order, not by id's or some other key.
> It's a legacy database and these info are in separate tables because these 
> info are filled by 2 different workers.
>
> For example:
> In process 001205 (CodProtocolo) we have 3 documents.
> One worker will give them some classification code, like 2,5 and 10 
> (meaningful for some purpose) in one program for the process 001205.
> Then he identifies them (physically) as 1,2,3 (always in code's ascending 
> order)
> Another person will scan them in the specific order 1,2,3.
> This other program fills the table only inserting all into the process 
> 001205 with some data, the image blob and give one code for each.
>
> I know they are in order so I can use:
>
> ROW_NUMBER() OVER(ORDER BY CodImagem) as ImgIndex
>
> and
>
> ROW_NUMBER() OVER(ORDER BY CodDocumento) as DocIndex
>
> and JOIN them
>
> Is there a way to accomplish it using the dal?
>
>
I'm not sure I'm keeping track of what's going on here.  Perhaps you could 
show your table defs and some sample rows?

/dps
 
 

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