casting of the extracted value in sql
Hi World
I've a problem when in extract a float value from my database
the problem is that i get an interger instead of float.
my record is 2,56 but when i do a select , the request extract only 2
can you have a solution for it.
thank you
Discussion (4)1
Comments
Are you just selecting the property? If so can you please provide property definition.
the property is declared as folow :
Class dc.demo Extends %Persistent
{
Property ChildPrice As %Library.Float;
ClassMethod Test()
{
;d ##class(dc.demo).Test()
d ..%KillExtent()
s obj=..%New()
s obj.ChildPrice=2.56
d obj.%Save()
&sql(select ChildPrice into :ChildPrice from dc.demo where %ID=1)
w ChildPrice,!
}
}
My result:
USER>d ##class(dc.demo).Test()
2.56What will be the result you have?
Also check the settings for the format of the data types in your tool (DbVisualizer, Caché Monitor, WinSQL, SQuirreL SQL, etc.), in which you make a selection.
If you are using the comma as the decimal separator, then perhaps something isn't able to handle this as you expect.