Hi All,
I am facing an issue using a Stored Procedure. We have scenario where the SPROC need to fetch the records from the Database, lets say I have a UserID's - 25 & 35 who belong to same group "ABC" which is configured in database where UserID - '25' have 4 records and UserID - '35' have 6 records individually. The SPROC which was created has an input parameter 'UserID' and programID(common records based on based on programId given), When I call my SPROC with either of UserID(25 or 35) it should fetch all the records from both UserID records because they belong to a same group. Lets say when I call my SPROC with UserID - '25' it should fetch '10' records combining user's(25 and 35) as well and vice versa. And this works absolutely fine when I call it on my database MySQL Workbench.
Working fine as expected from DB side:set @inUserID = 78;set @inProgramID = 1;call PDEVAppian.sp_GetQPRListByUserIDAndProgramID(@inUserID, @inProgramID);
But when I am using it on Appian by using 'fn!executestoredprocedure()' in an interface it is fetching only the UserID's individual records. For example: fn!executestoredprocedure( "jdbc/PDEVAppian", "sp_GetQPRListByUserIDAndProgramID", { name: "inUserID", value: ri!userId }, { name: "inProgramID", value: ril!programID } )
when I pass UserID as '25' it is fetching only 4 records and when passed with UserID as '35' it fetches '6' records, in both cases it should actually fetch '10' records when either of UserID is passed as they belong to same group which is designed in StoredProcedure. Its working fine on Database but not working with fn!executestoredprocedure
Can someone please provide some thoughts on this, Thank you.
Discussion posts and replies are publicly visible
It looks like you are passing in each name/value pair as a separate parameter, but the function is expecting one list of inputs. Try calling fn!executestoredprocedure( "jdbc/PDEVAppian", "sp_GetQPRListByUserIDAndProgramID", {{ name: "inUserID", value: ri!userId }, { name: "inProgramID", value: ril!programID }} ) Note the extra set of {} that makes the name/value pairs one single list of name/value pairs rather than individual inputs.