Element type "MAX" must be followed
I have a map with a dbquery(‘select max(HCP_STAGE_ID) from HCP_STAGE where CLIENTHCPLOCATIONID = '327EF-695DC12071FF' and CLIENTHCPID = '02D8C',$dbinfo,’true’). The query is in a variable. The query works fine with when I don’t put min. But if I have min(HCP_STAGE_ID) or max(HCP_STAGE_ID)it errors out saying: Please check error in the end. Please advise. It is oracle database.
; Line#: 5; Column#: 1396
javax.xml.transform.TransformerException: com.adeptia.indigo.services.ServiceException: Error while executing query:select max(HCP_STAGE_ID) ....
-
Oracle Query is returning a single value and the DB query used in the mapper is expecting multiple values for the target column.
For resolving this issue there are two possible ways. One is to modify your DB query used in data mapper so that it will return a multiple value from the database. Or you can change the third input Boolean value of the DB Query to 'False' in the Data Mapper that will always fetch the first matching value. The DBQuery with value false should be like this :
//Max value
dbquery(‘select max(HCP_STAGE_ID) from HCP_STAGE where CLIENTHCPLOCATIONID = '32311FF' and CLIENTHCPID = '029633BB-BAC',$dbinfo,’false’)
//Min value
dbquery(‘select min(HCP_STAGE_ID) from HCP_STAGE where CLIENTHCPLOCATIONID = '32317FF' and CLIENTHCPID = '029633BB-BAE3-4C',$dbinfo,’false’)
0
Please sign in to leave a comment.
Comments
1 comment