Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Verified Answer
+1
person also asked this
people also asked this
Replies
15 replies
Subscribers
5 subscribers
Views
9483 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
fn!executestoredprocedure error
Philip Kang
Appian Employee
over 7 years ago
simple expression rule using fn!executestoredprocedure gives me "java.lang.Integer cannot be cast to java.lang.Long" error, while smart service works fine in process model.
SP code:
CREATE PROCEDURE SCL_SumContract_Dealer (
IN dealer_id int,
OUT total_value int
)
BEGIN
SELECT SUM(price) INTO total_value FROM contract
WHERE contractstatus_status_id = 1 AND dealer_dealer_id = dealer_id;
END
OriginalPostID-255998
test_sp.txt
Discussion posts and replies are publicly visible
Parents
+1
Sally Mason
Appian Employee
over 7 years ago
As fn!executestoredprocedure() is part of the shared component, "Execute Stored Procedure" and is designed to be used in a Process Model, so that may explain the variation/why the behavior is different outside the Process Model
Another idea is using MySQL to create a new View at the Database level and use MySQL cast() as UNSIGNED to handle the conversion from SMALLINT, then query the view eg:
---
CREATE VIEW SCL_SumContract_Dealer_View AS SELECT CAST(total_value AS UNSIGNED) FROM SCL_SumContract_Dealer`;
---
Or, potentially use the SELECT statement in executestoredprocedure() to cast() as:
---
SELECT CAST(total_value AS UNSIGNED) FROM SCL_SumContract_Dealer`;
---
Let us know if that works in your scenario?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Reject Answer
Cancel
Reply
+1
Sally Mason
Appian Employee
over 7 years ago
As fn!executestoredprocedure() is part of the shared component, "Execute Stored Procedure" and is designed to be used in a Process Model, so that may explain the variation/why the behavior is different outside the Process Model
Another idea is using MySQL to create a new View at the Database level and use MySQL cast() as UNSIGNED to handle the conversion from SMALLINT, then query the view eg:
---
CREATE VIEW SCL_SumContract_Dealer_View AS SELECT CAST(total_value AS UNSIGNED) FROM SCL_SumContract_Dealer`;
---
Or, potentially use the SELECT statement in executestoredprocedure() to cast() as:
---
SELECT CAST(total_value AS UNSIGNED) FROM SCL_SumContract_Dealer`;
---
Let us know if that works in your scenario?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Reject Answer
Cancel
Children
No Data