VERIFIED SOLUTION i

Resolve Error with queries that have >255 characters in Exponare

Issue

The following error occurs in Exponare Enquiry:

Exponare Enquiry
Exponare Enquiry could not complete your request. It is possible that the Exponare Server is experiencing a problem or that your computer has lost communication with the Exponare Server.

Select Recover to attempt to recover your current session or select Log Off to end your current session.


Advanced Details:

Message 1803: The Exponare Server responded with:

Error 1386: System error. Please contact support with the following information:

Message: Unable to parse statement : Select MI_Key from "CITY" where "CITY.UPI" IN (12487, 102966, 5598, 48379, 41219, 49134, 58368, 39982, 103898, 12248, 49500, 49502, 43696, 39169, 43573, 51112, 40561, 52913, 15653, 28250, 44189, 44874, 52989, 28621, 56542, 17885, 31259, 43238, 102206, 9055, 106979, 106980, 10421, 106992, 34063, 23949, 106771, 26723, 53617, 39796, 44309, 60310, 37571, 106391, 25447, 58064, 42262, 107130, 1444, 45626, 105789, 44034, 44035, 41483, 48085, 58705, 13171, 15862, 27982, 51055, 20238, 20221, 32368, 56387, 32413, 49632, 41481, 51484, 27591, 3527, 19475, 15379, 46887, 28804, 51155, 54730, 18500, 52999, 23339, 34401, 54311, 51687, 107595, 37523, 42917, 5382, 59356, 29840, 61015, 25146, 45796, 51485, 29653, 51614, 106728, 10963, 101744, 789, 40568, 44921, 44922, 40567, 102784, 351, 1977, 2031, 2030, 105384, 51210, 102097, 46014, 51647, 49952, 21303, 51384, 54558, 46471, 4539, 42846, 46418, 11120, 46427, 104920, 41585, 53367, 44241, 12951, 14263, 60847, 60848, 21036, 60032, 52324, 43574, 103850, 54532, 54533, 54537, 54541, 54543, 51137, 34337, 40828, 51124, 61166, 17079, 32340, 56413, 56046, 51225, 29064, 33933, 48227, 44592, 35946, 6622, 6590, 51442, 32206, 43770, 47441, 46316, 35929, 35790, 55377, 60665, 37608, 144, 105299, 39173, 7458, 38479, 33624, 50740, 106390, 35536, 45115, 44194, 60614, 60653, 4842, 106829, 51277, 45687, 35679, 44556, 59763, 59764, 37527, 49941, 56799, 34574, 46376, 46377, 55005, 38803, 60532, 59261, 59262, 38233, 38098, 36505, 49133, 59260, 59263, 45530, 45529, 103762, 37559, 107431, 38096, 38095, 59726, 37765, 104761, 105106, 58728, 40377, 40378, 40959, 59271, 45949, 41440, 41981, 41986, 43615, 43616, 44079, 43642, 43552, 45014, 45015, 44686, 44657, 45016, 45017, 19080, 46329, 46332, 52864, 50918, 59253, 58399, 58398, 59287, 102134, 102135, 102136, 102198, 103558, 103559, 103803, 103510, 103911, 107054, 107055, 58708, 104148, 106068, 106719, 106716, 106718, 107003, 106870, 107011, 107334, 107393): Too many constants in subexpressions (Maximum is 255).
Stack trace: at MapInfo.Data.MICommand.Prepare()
at MapInfo.Data.MICommand.ExecuteReader()
at MapInfo.Exponare.Proxy.MICommandProxy.ExecuteReader()
at MapInfo.Exponare.Services.ExponareService.RunQuery(Int32 queryId, Object[][] queryParameters, AdvancedParameterRow[] queryAdvancedParameters, Boolean hideUnselectedFeatures)

Cause

The “Maximum is 255” refers to the number of constant in the expression (12487, 102966, 5598, …). It is the limitation with the MapXtreme function.

Resolution

UPDATED: August 24, 2017
To workaround this, use SELECT CITY.ObjectId FROM “CITY” … instead of Select MI_Key from "CITY" …
The workaround will use the database table to run the query instead of the native tab file.
Environment Details