cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Primary Keys are Type Casting

Ike@ACE
15-Moonstone

Primary Keys are Type Casting

So, I've had a problem with data table keys for a while now. When I set a number field as the primary key for a Data Shape and it gets used by a data table, the "key" field gets type-casted in a weird way. Whereas the data shape's field, say "Item", is filled with the number "10", the key field is stored as a string and the "Item" field gets type-casted that way and the resulting string ends up being "10.0". This results in problems when you try to search by the number "10", it will say that there is no such key. I've been programming around this problem, but I'm starting to get worried about future upgrades to ThingWorx causing problems for me. Is this going to be a problem for me in the future? Has it been fixed since ThingWorx 8.5? Is there a way to stop ThingWorx from adding the extra ".0"? Any help would be greatly appreciated.

ACCEPTED SOLUTION

Accepted Solutions
kazunari
12-Amethyst
(To:Ike@ACE)

Hi, how about using INTEGER for base type for you primary key?

View solution in original post

1 REPLY 1
kazunari
12-Amethyst
(To:Ike@ACE)

Hi, how about using INTEGER for base type for you primary key?

Announcements


Top Tags