But this may be very inefficient as some fields could be quite expensive in
order to populated. Why it does waste resources populating fields which
will not be read?
It would be possible to get the parsed query at an earlier step and pass
the selected fields to the tablefunction?
The question above is related to another Table functions issue:
The tablefunctions syntax is not compatible with 3rd party tools like
Jaspeerreport Studio for Eclipse: Table functions are not listed as
regular tables, so a lot of power is missing like writing queries by using
the built-in editor, drag and drop fields, etc.
A workaround would be intercept and rewrite all the original queries for
table functions.
For example rather than
Select a,d from tablefuction('foovalue')
Then
Create a regular table T(a,b,c,d) which will be fully supported by any 3rd
party tools (listed, drag an drop,.. )
Then intercept all the queries against the T table and modify the query on
the fly to make it compatible with the underlaying tablefunction:
User:
Select a,d from T where foo=vaule
It has to be transformed into:
Select a,d from table function(foovalue,[a,d])
This would allow to populate the table function with the right data (too)
and in a efficient way by populating the (a,d) columns only.
As I guess it is not supported by h2, so the question will be: how to
rewrite queries on the fly? (Even modifying the sources)
Thanks,
Pablo
El 08/04/2015 13:41, "Noel Grandin" <[email protected]> escribió:
> There is no way to do that currently.
>
> "functions as tables" always has to return the same set of columns, and H2
> will then drop the ones that the user did not request.
>
> For what you want, you would have to implement a custom table:
> http://h2database.com/html/features.html#pluggable_tables
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/h2-database/TsADaWCqh1A/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.