[odb-users] Re: Joined queries

Nicholas Cremonesi nicholas.cremonesi at gmail.com
Tue Mar 10 09:19:29 EDT 2015


Hello Boris, thanks for reply,


I'll explain you my situation, so maybe you can help me choose the best
practice to follow.
My database consists of over a hundred tables and I cannot know before
compilation all possible 'join' queries I'll need. How do you advise me to
proceed?

2015-03-10 13:01 GMT+01:00 Boris Kolpackov <boris at codesynthesis.com>:

> Hi Nicholas,
>
> Nicholas Cremonesi <nicholas.cremonesi at gmail.com> writes:
>
> > I supposed to use views.
>
> Yes, views are probably what you need.
>
>
> > But my question is: can I define a view directly in my main.cxx when
> > I need them, or I have to all possible views before hxx compilation?
>
> A view has to be compiled by the ODB compiler so it has to be defined
> in the header. But, if you have multiple queries that have the same
> result (i.e., number, type, and order of columns), then you can reuse
> a single view and specify the actual query at runtime. See Section
> 10.6, "Native Views" for details.
>
> Boris
>


More information about the odb-users mailing list