dglasberg Posted March 6, 2017 Share Posted March 6, 2017 Hi, Is there any way to convert a varchar to a float in a Domain's calculated field. I am pulling data from a MSSQL database. Thanks,Dennis Link to comment Share on other sites More sharing options...
Solution asimkin Posted March 8, 2017 Solution Share Posted March 8, 2017 Hi,you can specify your custom function in WEB-INFapplicationContext-semanticLayer.xml to convert varchar to float.There is str2int function already defined in the file, within "sqlserverGenerator" bean:<entry key="str2int"> <value>"cast(" + sqlArgs[0] + " as numeric(10,0))"</value></entry> You can add your custom one like<entry key="str2float"> <value>"cast(" + sqlArgs[0] + " as float)"</value></entry>then restart the server and use str2float() function in Domain Calculated fieldBest regards,Andrew Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now