Hierarchical (Recursive) Queries

Bart Pietercil bart.pietercil at cognosis.be
Wed Apr 1 08:02:25 CDT 2009


Hi Fabian,

http://www.valentina-db.com/dokuwiki/doku.php?id=valentina:articles:recursive_query

this should give you an idea. If it is not enough please come back and  
I'll try to be more specific.
things are working very well in our solution.

your query will probably look like this assuming address_id and  
manager_id are linked with a link namen 'lnk_man_address'
Watch out the recursive queries only work for recursive links (a link  
to points from both ends to the same table)

select * from (descendants of recid_of_root_manager to level 3 using  
lnk_man_address with root)

Read about the difference of using to or on and the meaning of with  
root in the article

hth

Bart

On 01 Apr 2009, at 11:44, Fabian Eschrich wrote:

> Hi,
>
> Ruslan told me about the new hierachical (recursive) queries  
> functions in valentina some days ago. As my app works alot with such  
> folder structures inside the database, I wanted to give it a try.
>
>
> If I understand correctly, I need a link for it.
>
> My table looks like the following
>
> id
> manager_id
> address_id
> startdate
> enddate
> ...
>
> address_id points to manager_id. Each manager_id could have an  
> additional record in the table where it is the address_id.
>
> I think this is the idea behind hiearchical queries. But I dont know  
> how to start with it.
>
> What do I have to do, if I want to get all the "root nodes" and its  
> childs and grandchilds and so on?
>
>
>
> Mit freundlichen Grüßen / kindly regards,
>
> Fabian Eschrich
> FAESCH Software
>
> info at faesch.de
>
> Fon:     +49 (0)37206 889293
> Fax:     +49 (0)37206 889294
> Skype:   feschrich
>
>
> _______________________________________________
> Valentina-beta mailing list
> Valentina-beta at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina-beta
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list