In a message dated 98-06-16 01:56:17 EDT, you write:
It’s not a problem of what I want to do or not. It’s a problem that BO
generates a query as if the target system were Oracle (that supports grouping by function) and this is wrong.
Ah, but it is not Oracle SQL that is being generated by Business Objects… it is just SQL. There are many databases other than Oracle - most of them, in fact - that support grouping by a function. You can check this by creating a similar query in MS Access; grouping by a function is allowed there. Sybase, Informix, SQL Server… all of these allow this feature to a certain degree. This feature is, in fact, part of the ANSI Standard definition for the SQL language.
The root of the problem is that DB2 is very much behind in implementing Standard SQL. They only recently added outer joins!
So, possible solutions could be
- create objects that are valid at all times (which would mean eliminating the sum() objects)
- create contexts that prevent objects with functions from being combined with aggregate objects
- try some tricks with Aggregate Awareness / incompatible objects 4. train your users what they can and cannot do.
You say that you feel this is a problem because BusObj does not check for DB2 before generating the SQL… how would you write the SQL any differently? What would you want BusObj to do in your case? What would be a proper solution? After you answer those questions, perhaps you can recreate your objects to support your solution.
Given the restrictions of DB2 there does not appear to be a way to generate the correct SQL given the current logic in your objects.
A new thought… have you considered building your report using two queries? I no longer have your original question, but you were looking at something like:
select substr(x), sum(y)
from tab
group by substr(x)
… which caused a DB2 syntax error. You could create a report using two queries, perhaps, that would look something like this:
(Query 1)
select x, sum(y)
from tab
group by x
(Query 2)
select x, substr(x)
from tab
Query 2 does not require a GROUP BY because there are no other Group functions. The common object ‘x’ would be the “link” column between your two queries. I’m not sure whether this is more intuitive for users than simply removing the sum() from object y and letting BusObj do the aggregation on the client side.
Regards,
Dave Rathbun
Integra Solutions
www.islink.com See you in Orlando in '98!
Listserv Archives (BOB member since 2002-06-25)