Hi. I have a bunch of activities organized into a hierarchy. For each activity, an activity diagram is specified with partitions and sub-activities, so the hierarchy looks like this:
Activity 1
+ Partition 1
Subactivity 1 by Partition 1
Subactivity 2 by Partition 1
+ Partition 2
Subactivity 1 by Partition 2
Subactivity 2 by Partition 2
I'm trying to develop a SQL search finding subactivities for activities, that is, those items being second-level children, to keep it simple.
I thought the following would work, but it does not:
select
subActivity.ea_guid as CLASSGUID,
subActivity.Name as [Task],
subActivity.Object_type as [Type]
from
( (
t_object as activity
inner join t_object as partition
on partition.parent_ID = activity.Object_ID
)
inner join t_object as subActivity
on subActivity.Parent_ID = partition.Parent_ID
)
where
activity.Object_Type in ('Activity', 'Action')
and
activity.Name like '#WC#<Search Term>#WC#'
order by activity.Name, subActivity.Name
When running the query, I receive a DAO 3061 errors, saying "Too few parameters. Expected 2". Trying to run the query in a 3rd party tool on the EAP file yields in error "Parameter partition.parent_id has no default value".
I have also tried the following variant of the query:
select
subActivity.ea_guid as CLASSGUID,
subActivity.Name as [Task],
subActivity.Object_type as [Type]
from
t_object as activity,
t_object as partition,
t_object as subActivity
where
partition.Parent_ID = activity.Object_ID
and
subActivity.Parent_ID = partition.Object_ID
and
activity.Object_Type in ('Activity', 'Action')
and
activity.Name like '#WC#<Search Term>#WC#'
order by activity.Name, subActivity.Name
The results are the very same.
Could you, please, tell me what am I doing wrong? I know error 3061 usually refers to names what JET can not resolve, but I could not find such a typo in the code. And why lack of a default value would prevent me from checking the equivalence of such a field?
Gus