Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
18 replies
Subscribers
7 subscribers
Views
4359 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
We are using MS SQL Server and for one of a column(SharePercent), we have below
Mahesh Sanga
over 8 years ago
We are using MS SQL Server and for one of a column(SharePercent), we have below definition in our CDT.
<xsd:element name="SharePercent" nillable="true" type="xsd:decimal">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(name=SharePercent columnDefinition="Decimal(15,12)")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
In the underlying table we have column SharePercent definition as "SharePercent(decimal(15,12), not null)" and we have below values for this column
50.508771927000
19.442982457250
19.442982457250
10.605263158500
We have created a query rule to return these values but the values are being rounded up to 5/6 so, the query rule is returning below values.
50.50877
19.44298
19.44298
10.60526
Should we change the CDT definition to return all decimal values?
OriginalPostID-163295
OriginalPostID-163295
Discussion posts and replies are publicly visible
0
Poorna Guduri
A Score Level 1
over 8 years ago
I have tried in Oracle SQL Developer. Even after increasing the values of precision and scale, still the query rule is returning the output with 5 digits after the decimal place.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 8 years ago
Tried by creating a sample Table but still didnt work. Attached screenshots.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 8 years ago
Maybe it's just how it's being displayed and the value is being retrieved correctly. Try displaying it using the fixed() function so you can confirm the precision in the display.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
This looks like a limitation with the decimal type - I've just tested in 7.9 and get the attached.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
Apologies, Eduardo is right - this returns correctly:
fixed(
todecimal(
99.123456789
),
9
)
...so it's just the display.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 8 years ago
Thanks Eduardo, fn!fixed has fixed the issue.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
madhanka
A Score Level 1
over 8 years ago
Hi Mahesh, Is the issue resolved now? If not resolved, can you please let me know whether your CDT was migrated to 7.9 from a lower version?
I had faced a similar issue few months back in my cdts which had the type "double". My code was working fine in 7.5 but when migrated to 7.9, I started facing this issue. I was able to resolve it by doing the following steps.
1) Download the CDT (you can download it from the same environment where you are facing the issue).
2) Delete the CDT
3) Import the CDT downloaded in step 1 and perform a dependency check
I performed the above steps in all my CDTs which had double and the issue was resolved.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 8 years ago
Thanks Madhank for sharing your solution. As per Eduardo's suggestion, I tried using "fixed" function then i was able to display all decimal values without losing any digits.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<