Jump to content
We've recently updated our Privacy Statement, available here ×

Convert Varchar to Float via Domain Calculated Fields


dglasberg
Go to solution Solved by asimkin,

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

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 field

Best regards,
Andrew

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...