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
3 replies
Subscribers
7 subscribers
Views
1359 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I am looking for an example of a Query Database Integration Service that shows d
markw91
over 9 years ago
I am looking for an example of a Query Database Integration Service that shows dynamic SQL. Any sugges
OriginalPostID-156490
OriginalPostID-156490
Discussion posts and replies are publicly visible
0
Chris
over 9 years ago
We have not been able to find a way to include dynamic SQL, although you could get a little fancy by executing code from within a stored procedure. However, your inputs/outputs have to be explicitely defined, so querying a dynamic number of columns will most likely not be possible without somehow combining your data within the procedure and parsing the result within BPM. Something like:
CREATE PROCEDURE [dbo].[Procedure1]
@varColumn nvarchar(max),
@varTable nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @SQL nvarchar(max)
SET @SQL = 'SELECT ' + @varColumn + ' FROM ' + @varTable;
EXEC (@SQL)
END
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
markw91
over 9 years ago
...would you have a code snippet showing how to call a parameterized stored procedure?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chris
over 9 years ago
You can use the Execute Stored Procedure node - Data Source Name is in text format, as ="java:comp/env/jdbc/datasource_name_here", Procedure Name is the plain text name of the procedure, ="ProcedureName". From there, create Inputs for each of your parameters including the output paramater - and map them however you would like. Note, node input names must match the parameter names exactly. Let me know if tha thelps.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel