Column values type for LABKEY.ext.Store

LabKey Support Forum (Inactive)
Column values type for LABKEY.ext.Store Leo Dashevskiy  2013-04-10 11:24
Status: Closed
 
Hello!

I am using LABKEY.ext.Store with an sql config option.

I am seeing that if the query column has values, which are all strings (with at least one non-numeric character), then within the store the type of the records of that column is set to 'string', whereas if the query column has what looks like numbers, then within the store the type of the records of that column is set to 'numeric'. The thing is, I need for uniformity and conformity to have those 'numeric' field types to actually be 'string' (i.e. 5 should be in fact '5') -- are there configs to achieve this?
If not, then how should Store.js be tweaked/overridden to get this to work or may be it is the database that returns the 'numeric' columns and the store has nothing to do with it and just consumes what it's fed, and in that case it's the query properties (where?) that need to be modified, I'm not sure.

Your help is appreciated.
Thanks.
-Leo
 
 
Ben Bimber responded:  2013-04-10 11:26
if your SQL statement explicitly casts them to VARCHAR maybe that would do it. something like:

SELECT CAST(myNumber as VARCHAR) as myNumber FROM lists.mylist

i have not tested that.
 
Leo Dashevskiy responded:  2013-04-10 11:45
Great suggestion, Ben, thanks, didn't think of that, and it seems to work just the way I'd like!