|
Date: 2/17/2008 5:13 pm · Subject: SQL Report how to use prequery statements · Rating: 9
Hi all, I have an SQL report that I use to search through several Collaboration Systems. I want both a percentage relevance and a total number of found pages. For this I need the highest relevance and the number of found rows. Therefore I do the search twice. The first time I limit the results to one and order on relevance, so I get the highest relevance that I can use to calculate the percentage. At the same time I use the SQL_CALC_FOUND_ROWS function, so I can display the found rows in the next query. For this last thing I put in the prequery statement of the second query: set @rows := FOUND_ROWS(); However this does not work. With debug on, the SQL Report says: Debug: Prequery statement is not allowed: set @rows := FOUND_ROWS(); But even if I use the example from the hoover-help it says: Debug: Prequery statement is not allowed: set @myVariable := 3 How am I supposed to use prequery statements? (Btw if somebody knows how to use a value from the first returning row of the result in all other rows of the same result, that would be helpfull as well, but I think that's not possible.) Kind regards, Arjan Widlak United Knowledge Internet for the public sector www.unitedknowledge.nl
--- (Edited on 18-February-2008 00:13 [GMT+0100] by arjan) ---
|