Yes I sure can, It will be a bit complex to follow though as it comes from a few tables.
I am grateful for any assistance I can get with this thank you.
The "dbo.Associates_Links_Basic.Item_ID" is the primary key in the table.
The table displays fine and works ok. until I try to query it then select the object from the list in spectrum spatial.
As an example I might query a owner name like "Ball" this component works and returns 6 entries from the table.
I scroll to the one I want to select and show on the map that when it fails.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SELECT dbo.Associates_Links_Basic.Item_ID, CAST(LTRIM(RTRIM(REPLACE(ISNULL(dbo.Associates_Basic.Name_Value_1, ' ') + ' ' + ISNULL(dbo.Associates_Basic.Name_Value_2, ' '), ' ', ' '))) AS Varchar(255)) AS Name,
CAST(dbo.Properties_Basic.Property_Id AS Varchar(20)) AS Property_Id, CAST(dbo.Associates_Links_Basic.Ownership_Percentage AS Varchar(10)) + '%' AS Owner_Percentage,
dbo.Associates_Basic.Contact_Email_Address_Home AS email, dbo.Associates_Basic.Contact_Phone_Number_Home AS HomePhone, dbo.Associates_Basic.Contact_Phone_Number_Mobile AS Mobile,
dbo.Properties_Basic.Full_Street_Address AS Address, dbo.Associates_Basic.Type AS AssociateType, 'Property Owners' AS FeatureType, 'Property-Parcel' AS MapGroup, 'Region' AS FeatureClass,
dbo.Properties.SP_GEOMETRY
FROM dbo.Associates_Basic INNER JOIN
dbo.Associates_Links_Basic ON dbo.Associates_Basic.Item_ID = dbo.Associates_Links_Basic.Associate_Id INNER JOIN
dbo.Properties_Basic ON dbo.Associates_Links_Basic.Linked_ID = dbo.Properties_Basic.Item_ID INNER JOIN
dbo.Properties ON dbo.Properties_Basic.Property_Id = dbo.Properties.PropNum
WHERE (dbo.Associates_Links_Basic.Type = 'Property') AND (dbo.Properties_Basic.Defunct = 1) AND (dbo.Associates_Links_Basic.Ownership_Percentage > 0)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------
Russell Ferguson
Ararat Rural City Council
Ararat VIC
------------------------------
Original Message:
Sent: 06-24-2021 00:48
From: Nigel Lester
Subject: Question about sql queries in SSA (I'm tearing my hair out)
Hi Russell,
Can you share the SQL query you are using?
I have seen this kind of error in SQL Server before when I forgot to enclose a number (in varchar column) in single quotes. Wondering if it is something similar here.
Cheers,
Nigel Lester
The Spatial Distillery Co.
------------------------------
Nigel Lester
The Spatial Distillery
Fitzroy VIC
Original Message:
Sent: 06-23-2021 23:55
From: Russell Ferguson
Subject: Question about sql queries in SSA (I'm tearing my hair out)
I have created some predefined queries in SSA 20.1 all works correctly using mapinfo native tab files.
I also have some tables in sqlserver 2019, that I wish to query eg: "search for a property owner name" I can set up the search and it works ok until I click on one of the rows from the selection list that appears in the left panel, as soon as I select a record it gives a server error and freezes the interface, you cannot do anything until the browser is refreshed and you start again. Sometimes a restart of the platform is required to fix the issue.
Error from the log file
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2021-Jun-24 11:55:20,851 [ConnectSpatialRestProxyAction] [tenant=analyst, host=GIS, thread=http-nio-8010-exec-5]
[ERROR] Response body: {"type":"com.mapinfo.midev.service.feature.ws.v1.ServiceException","message":"java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting the nvarchar value 'undefined' to data type int."}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
There is no NVARCHAR field in the view I am querying. but here is a field that has a name concatenation in it of, [surname], [first name] etc.
could it be that this is causing the issue.
I have been trying to get several sql server queries works for days and have had no success.
If I recreate the table same table as a native mapinfo table, and test the same query, it works perfectly with out issue.
------------------------------
Russell Ferguson
Ararat Rural City Council
Ararat VIC
------------------------------