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
15 replies
Subscribers
4 subscribers
Views
12552 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Reports
Execute Procedure and Display Data on Tempo Report
Sowrabha Rajashekar
over 7 years ago
Hi All,
I have a requirement that I need to insert data through a stored procedure and display the result- set on the report on a button click. I cannot be using executestoredprocedure function as it doesn't support for insert/update statements. So , I was trying to do with a!startprocess - And the process model runs the execute stored procedure smart service or using web-api with a!start-process. I'm getting results, but the problem is that a!start process will only start the process asynchronously and will not wait till the process gets completed. So I'm worried on the credibility of the output of that process. It would be very helpful if someone can suggest a solution for this.
OriginalPostID-266159
Discussion posts and replies are publicly visible
0
jagadeesh
Certified Senior Developer
over 7 years ago
Hi Sowrabha, fn!executestoredprocedure accepts inputs as well and it return output parameters back. You can call fn!executestoredprocedure on button click and get the result set into variable and render that variable on interface.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sowrabha Rajashekar
over 7 years ago
Hey Jagadeesh, Yes, it does accept inputs, but that doesnt work for Insert / Update Statements. Please find the comments by James Carter, who updated the plugin recently.
forum.appian.com/.../e-137289
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
kumara0002
A Score Level 1
over 7 years ago
Hi, as far as i understood , you are more interested to write data in DB(insert/update). Probably you can consider a!writeToDataStoreEntity() in the required place and see whether it helps to meet your goal?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sowrabha Rajashekar
over 7 years ago
Hi Kumar, The requirement is that based on the selected inputs on the report, I'm generating data (Processing is huge, doing it on Appian would take lots of time. So we are doing it through Stored Procedure) and insert this new processed data onto a table and immediately display the output in a grid on the report
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sowrabha Rajashekar
over 7 years ago
Displaying data has much emphasis or importance.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
kumara0002
A Score Level 1
over 7 years ago
Hi, Probably fn!executestoredprocedure() will serve your purpose if you could tweak the statements of stored procedure with insert and update DDLs where ever required based on the inputs(which can be send through the selection on the UI). startprocess wont serve the purpose efficiently. Better tweak the statements in your stored procedure definition and try?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sowrabha Rajashekar
over 7 years ago
Please find the comments by James Carter, who updated the plugin recently.
forum.appian.com/.../e-137289
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
kumara0002
A Score Level 1
over 7 years ago
How about using two stored procedures? One for displaying data in the SAIL and another for insert/update
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkateshamu
A Score Level 2
over 7 years ago
@sowrabha, AFAIK In this case there is no direct process but i think recursive functionality may be achieves your goal.
create one expression (exp1) rule which checks whether the data is inserted in database or not and returns boolean value.
and call this exp1 rule in other exp rule (recursive expression exp2) using if() function.
exp2: if(
rule!exp1(),
"display your data",
rule!exp2()
)
finally call this exp2 from your report.
it's my assumption only i am not sure whether it is work or not. let me know is it worked or not.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Josh
Certified Lead Developer
over 7 years ago
Two possible options: 1. modify the stored procedure plugin to allow inserts/updates but as Janes noted, this behavior is not supported. 2. Add a "Refresh Data" button on the report and train users that they may need to hit the refresh button after starting an asynchronous process.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>