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
7 replies
Subscribers
6 subscribers
Views
2384 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
I am working on a search screen. This search screen has more than 10 fields the
erickp
over 9 years ago
I am working on a search screen. This search screen has more than 10 fields the user can search by. After making a search, I want to populate the data on a grid. The search results consist of a very complex sql query with many joins. I am wanting to pass all my search criteria to a store procedure, execute the query and return the results to populate the grid. Is this possible? If yes, in what format do I need to return the results and how?
OriginalPostID-198295
OriginalPostID-198295
Discussion posts and replies are publicly visible
0
Amitkumar
over 9 years ago
Take a look at Execute Stored Procedure smart service. Results can be stored in a CDT which then can be used to display results in a grid.
forum.appian.com/.../summary.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rajasekhard
over 9 years ago
Hi erickp
This is very much possible. Have you had a look at "Execute stored procedure" smart service.
forum.appian.com/.../summary
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@erickp If your intention is to make a query on the SAIL interface itself with the search parameters being involved, make use of fn!executestoredprocedure() in the same link mentioned by other practitioners above.
Whether it might be a smart service or function, as you are saying that the stored procedure contains complex sql and many joins, it might be worth having a plan of limiting the results as per the grid's pagingInfo. (For instance, we would be limiting the number of results by making use of the paginInfo in queryrecord() or queryEntity() while querying a table or view)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
erickp
over 9 years ago
Got it. But when I use alias, like select value as 'valueName', I am getting some error in Appian when using the function fn!executestoredprocedure. I am using Sybase database. Anyone knows why I am getting error when I use aliases?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@erickp I would suggest you asking the question to James Carter at
forum.appian.com/.../e-137289
if possible.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Josh
Certified Lead Developer
over 9 years ago
I'm not sure if this will apply to Sybase but I ran into an issue with aliases with Appian (7.10) and mysql when "useOldAliasMetadataBehavior" was not set correctly. The solution was to configure the jdbc connection like so: jdbc:mysql://server:3306/appian_primary?useOldAliasMetadataBehavior=true
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sachinr528
over 9 years ago
Hi Erick, You can use stored procedure for your use case, but it will increase complexity of your use case. In this case, you should use a!queryentity() provided by Appian.
In case your data is coming from tables after some aggregation or other manipulations I suggested that you should create a view with that manipulation as it is easy to made calculation on DB and It will be less complex than a stored procedure.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel