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
7 subscribers
Views
2692 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
I want to execute a query without using Query Database node. I think Query Rule
anilkumark
over 9 years ago
I want to execute a query without using Query Database node. I think Query Rule is the best way execute a query for faster performance. But how to use Query Rule for multiple entities? Which is best way to execute below query?
"select T1.* from TABLE_ONE T1 , TABLE_TWO T2
where T1.CUST_ACCT_ID = T2.PRNT_ACCT_ID
and T2.ORDR_ID = pv!order_id; "
Thanks.
OriginalPostID-155351
OriginalPostID-155351
Discussion posts and replies are publicly visible
0
sonalk
over 9 years ago
Hi Anilkumark,
To query data from multiple tables use View and then using query rule we can fetch the data from the View's entity.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@anilkumark AFAIK I don't think that Query database will always execute slower than the Query rules because out of my experience in some cases, a Query database node does the work quickly when compared to query rules especially when we are in the process (Infact we opted for Query database node at times for complex operations). And the decision to opt for Query database or Query rules depends on the situation as each way has got its own pros and cons. For example, you may not effectively parse the result of a native sql query on the SAIL interface and you should change the native sql query when the database vendor changes.
To complement Sonal's explanation, I would like to suggest to have a look at https://forum.appian.com/suite/help/7.9/Querying_Data_From_an_RDBMS.html if you prefer to opt for querying database using Appian's OOTB functionalities after getting the database views ready.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 9 years ago
Thanks Sonalk.
Cant we do this without creating Views. And after fetching the data, I have to insert into one another table.
Result of that query having about 40 columns. If I use Query Rule, then I have to run that Query Rule for each and every column (40 Times) in the Script Task and insert into table (CDT). Is it good?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 9 years ago
Thanks Sikhivahans. If there are no issues with Query Database node then I will go with Query Database.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@anilkumark Until and unless there is a strong reason (such as complex queries or OOTB query rules consuming lots of time etc) I would like to suggest you to opt for creating a view and then proceed with making use of Query entity because these doesn't require a change when the database vendor changes and also can be used anywhere without any constraints.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 9 years ago
@sikhivahans After fetching the data, I have to insert into one another table.
Result of that query having about 40 columns. If I use Query Rule, then I have to run that Query Rule for each and every column (40 Times) in the Script Task and insert into table (CDT). Is it good? If not what is the better way to save into another table. Thanks.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@anilkumark Out of interest, may I know why the query should be made for each column separately? The only thing we need to take care of is querying but not the writing part because Write to Data Store entity anyhow handles the write part in an elegant manner.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel