04-04-2013 07:06 AM - edited 03-14-2019 11:30 AM
Hello Everyone. I'm trying to add field from DB Get. It seems to picking up Variable for "java.lang.String". However, when I tried to add "java.math.BigDecimal", it does not show any selection for the variable Name to store... This is for a customer to call in and enter his/her Acct number then, it will give an opiton to check their payment balance.
Could someone help me what steps I'm missing?
Thank you so much
Nana
04-05-2013 12:46 AM
Hi,
each SQL column type is mapped to a certain Java type. For instance, if the SQL data type is int, it may be mapped to a Java variable of type java.lang.Integer.
In your case - assuming you are integrating with Microsoft SQL Server - the type of the CurrBalance column is money, this is why UCCX tells you it may be mapped to a BigDecimal type variable only.
You have two options:
1. if you have control over the database, you can create a new database view, casting the CurrBalance column to a more "friendly" type, like Integer,
2. use a BigDecimal type variable in UCCX. You can create one just like any other variables with friendly types.
G.
04-05-2013 07:44 AM
Hi G,
Thank you for your reply I asked my SQL admin and he informed me that actually "Current Balance" data is not BigDecimal. He said it is float. So, I created a variable in UCCX, "CurrentBalance" and select type as "float". Then, I went to add the field, I entered Data type as "java.lang.Float". However, it is still empty in "Enter the Variable Name to Store this Field:"
04-05-2013 08:10 AM
Since float is a Java primitive, could you just simply type float instead of java.lang.Float? Perhaps it will then show you your variable in the drop down. Just a suggestion.
EDIT: According to the documentation java.lang.Float and float are two different things. The former being a Class and the latter being a primitive data type.
"TheFloat
class wraps a value of primitive typefloat
in an object."
Source: http://docs.oracle.com/javase/6/docs/api/java/lang/Float.html
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
04-05-2013 09:23 AM
HI Antony, thank you for your feed back!
I just tried with "float" but still did not give me any selection in the drop down.. Since I can pull out Customer' account number, ID number and City, I think I am connecting the SQL database correctly... But somehow, Current Balance and Date (Last time customer made a payment) do not give me any option in the drop down....
If you have any other suggestions, I'll appreicate your support. (always)
04-05-2013 10:15 AM
Sorry it didn't work for you. And yes, I would agree you are connecting to the DB successfully.
Unfortunately, the DB integration, while trying to be user friendly and not require a BS in DB administration, has it's limitations and hang ups. Matching data types is one of them. Just keep trying different numeric type combinations, or open a TAC case. You may have found a defect.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
04-05-2013 11:07 AM
Thank you Anthony,
I opened a case with TAC and see what he says. But i always appreciate your support !
Nana
04-09-2013 08:11 AM
Hi G and Anthony,
thank you for both of your replies! I've opened a TAC case and seems to be this is caused by bugs... According to TAC, this should be fixed on 9.02 ES2.
Nana
04-30-2013 01:39 PM
Hi Anthony and everyone who is reading this.
By accident, I found out that somehow I have to use "double" data type instead of "float". I had a TAC case opened but he said if UCCX does not recognized the data type from SQL DB,
"The best way as far as uccx side is see the type of information that you are using and try different variables that seem to match that data type until you get the correct one. That really is the only way."
it sounds like bug to me but TAC is telling me that is not bug... If you can see the from SQL, the "CurrentBalance" is showing as float. I also checked with our DB guy and he confirmed that is correct data type. But when I try to get the data, i have to change data type to double. Lucky me, I accidentally find out double worked... My concern is if UCCX does not recognize the data type from SQL, then, how do I know what to select... What do you guys think?
SQL
Field Selection - When I use double, UCCX recognize but if I use float, it does not...
04-30-2013 01:56 PM
Hi,
no, it's not a bug - and, by the way, it's not UCCX's problem at all. The data type detection is done by the driver, in this case, JTDS, and presented "upwards" to Java, which, as we can see, shows it to you.
Take a look at this: http://jtds.sourceforge.net/typemap.html
Why? Simple. Float may mean something different in the Microsoft SQL world than in the Java world. Take a look at the definition of the Float datatype at the Microsoft doc site:
http://msdn.microsoft.com/en-us/library/ms173773%28v=sql.110%29.aspx
See? If precision is not specified, 53 is assumed, which is actually "double".
One more thing to consider: Float (and Double) values are always approximate and not meant to be used where precise values are required, such as currency. Even Microsoft and Sun Oracle are telling you this.
G.
05-01-2013 04:56 AM
HI G, Thank you for the links!!!! That was I needed it
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide