Error: java.lang.ClassCastException while using function fn!executestoredprocedure

Hello All,

I am trying to execute a storedprocedure using fn!executestoredprocedure in SAIL interface, but it is not executing and throwing some error as below.

Note: I am facing this issue for only this SPROC in one environment and rest of SPROCS are executing fine irrespective of environments.

with(
local!spResult: fn!executestoredprocedure(
"jdbc/PRSDEVAppian",
"sp_GetReportCountByUserID",
{
name: "inUserID",
value: ri!userId
},
{
name: "inReportType",
value: 2
}
),
local!spResult
)

Output:

Dictionary :

success: false

error: "java.lang.ClassCastException "

==================================

Expected Output/Working output in other environments:

Dictionary

success: true

error: null (Text)

parameters:

    Dictionary inReportCount: 162

result: List of Variant: 0 items

 

Please share your thoughts on this. Thank you.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi i believe it's an issue which is caused because of your Input Parameter of Stored Procedure. Basically this exception arises when the required type is different than what we have provided.

    For example, your userId expects Integer but we have sent an array of Integer or String or Double or any other type.

    Can you hard code the input parameters while invoking the Stored Proc and Test, whether it's working or not. And also can you try executing this Stored procedure from the DB side prior to executing from Appian.

    I believe it should work.
Reply
  • 0
    Certified Lead Developer
    Hi i believe it's an issue which is caused because of your Input Parameter of Stored Procedure. Basically this exception arises when the required type is different than what we have provided.

    For example, your userId expects Integer but we have sent an array of Integer or String or Double or any other type.

    Can you hard code the input parameters while invoking the Stored Proc and Test, whether it's working or not. And also can you try executing this Stored procedure from the DB side prior to executing from Appian.

    I believe it should work.
Children
No Data