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
8 subscribers
Views
1204 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
Parents
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
Reply
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
Children
No Data