In a message dated 99-03-10 05:19:13 EST, you write:
I’ve been trying to use constants in combination with Aggregate Awareness,
but always get the error ‘incompatible combination of objects’.Example: @Aggregate_Aware(A1.ID, ‘N/A’)
Thus, when the selected objects allow selection of table A1, A1.ID will be
retrieved. When this is not the case, I would like to display the
constant value ‘N/A’. However, this latter situation always displays the
error message.Has anyone experienced the same problem/found a work-around ?
Hmmmm, this is an interesting thought. I’ve never tried using a constant in
Aggregate Navigation before. I think I can see where your problem is coming
from though.
When you define AA (Agg Aware) objects, you have to define the AN (Navigation)
path as well. That’s the only way that BusObj can determine which piece of the
agg hierarchy to use. Since the constant is not really a table-based object,
it is (I am guessing) automatically incompatible with everything. Since is
cannot be determined if the “table” the object is compatible with any of the
other tables, BusObj makes the “safe” choice and assumes that it is not.
Another problem, as I see in your definition, is that AA objects are supposed
to flow from a higher level of summary down to a lower level of summary. In
your case, that is not what is going to happen. You start out with A1.ID,
which has at least one, and I am assuming more, values. You finish with the
constant ‘N/A’ which always has one value. Therefore, you are actually
navigating from a more specific to a more general object. That’s not really
what the AA process was intended to do.
You might be able to fake out the SQL using some other tricks. Since you
didn’t specify which database you are using, I’ll use Oracle since it is
easiest.
Build an object with a prompt that asks the user if they want the ID or not.
If they do, the object will return A1.ID. If they don’t, then the object will
return the constant ‘N/A’.
decode(upper(@prompt('Do you want ID’s rolled up? [Y/N]:
',‘A’,{‘Y’,‘N’},mono,free)),‘Y’,‘N/A’,A1.ID)
The decode() function looks at the response from the user. If the user enters
a ‘y’ or ‘Y’ it is translated to ‘Y’ and compared. If the result is ‘Y’ then
the constant ‘N/A’ is returned. If the response is ‘N’ (or ‘n’) then the ID
from the table A1 is returned.
This is not automatic, like an AA object would be. But it could get the job
done. Other databases have a selection of functions that can mimic the Oracle
decode() function; one of your database experts may be able to help come up
with a similar solution.
Regards,
Dave Rathbun
Integra Solutions
www.islink.com
Listserv Archives (BOB member since 2002-06-25)