cancel
Showing results for 
Search instead for 
Did you mean: 

QUERY - Use UNION with Dynamic join query

Former Member
0 Kudos

Hi Experts,

I am trying to use UNION in two queries so that I can have one value for two filter fields. When I keep the below filter statement, it works fine.

<%AND_OP("UPPER(T8.PARENT_OBJECT_ID)",<%?(T8.OBJECTID)%>) %>

<%AND_OP("UPPER(T5.MultipleRegionName_OBJECT_ID)",<%?(T5.MultipleRegionName_OBJECT_ID)%>)%>

<%DYN_FILTER%>

However, when I add UNION and copy past the same query, it gives me error :

SQL Exception: Missing IN or OUT parameter at index:: 1, ANSI-92 SQL State:

99999, Vendor Error Code: 17041.

If anyone has implemented UNION ALL with two query(having dynamic filters),request you to please paste the code snippet.

query-1
....

.....

<%DYN_FILTER%>

UNION ALL

query-2
....

.....

<%DYN_FILTER%>

Regards

Praveen

Eg. I want to get Document ID query 1- from Master Agreement where Doc.Owner = xyz UNION query 2 - from Agreement where Doc.Owner = xyz

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Praveen,

The number of parameters filters is not equals the number of  ?'s in your query. You need duplicate

the parameter used in first query.

Regards

Francisco

Former Member
0 Kudos

Hi Francisco,

I have used two filters in both the queries and used UNION between them.

Regards

Praveen