databaseManager.getFoundSetQuery(foundset)

Hello,

would this

databaseManager.getFoundSetQuery(foundset)

be possible? The function should return the SQL statement that was generated when retrieving “foundset”. I can’t imagine this too be hard to implement :) and see (at least) the following possibilities:

  1. Offer “search in results” feature when doing SQL based searches in Servoy (you can reuse the foundset in SQL since you know then the query that created it)

  2. Show a foundset definition in a form: in some areas it is extremely helpful to know what selection of data you have in front of you (especially in reporting). With this function you could interpret the WHERE-clause and show the criteria in readable form

And most important in my situation

  1. Be able to do mass operation on data using SQL: if your users search for whatever they like and want to start a database intensive job on that data, we currently have to loop, because we don’t know what the user search for. If we had access to the foundset query we could reuse that for further operations (subqueries etc.).

Is that possible? :lol:

Thanks
Patrick

Found a forth occasion where this comes in handy: restoring the users selection at a later point. I can image some areas where this is very useful.

Are there any comments on this?

Hello,

I have to ask again, because I think I really need this. I can image this to be a foundset property, too. Then I could do a

foundset.query

or

foundset.getQuery()

Can this be done?

Thanks
Patrick

need to check this with Jan B. How and if we are going to support this.
For example what about the data there is in the query?
Our queries don’t have data inside queries, but are all using prepared statements..
So you would get:

select X from Y where z = ? and t = ?

and couldn’t I get the arguments array as well? Maybe

foundset.getQuery()

delivers

select X from Y where z = ? and t = ?

and

foundset.getQueryArguments()

delivers an Array of arguments? Without arguments I can’t use it…

Is on the todo for 3.0
*NOTE: as usually this is not a 100% guarantee but in general this means it will get in