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
4464 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Query Database Smart Service
jurim409
A Score Level 1
over 7 years ago
Hi,
I need to use a Query Database Smart Service to update many rows in my table.
I need to replicate the following query:
update [table] set [column1]=1 where [column2] in ('A','B');
A and B will be my values in the process variable. I would find a method to do it without running a multiple istances.
Do you know another methods?
Thanks in advance.
OriginalPostID-255471
Discussion posts and replies are publicly visible
Top Replies
Venu
over 7 years ago
+1
@Jurim409, I think your A & B values will come form process variables. You need to convert the array values to single text value using joinarray function. Joinarray(pv!array,","), map this logic to you…
0
georgej
over 7 years ago
Is it like you want the query to be run with dynamic values for A & B and at the same time don't want to accomplish this using MNI's
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sachin
A Score Level 1
over 7 years ago
@jurim for your scenario for updating the multiple columns you can use store procedures,
for example
create procedure
[procedure name]
( input1 IN,input2 IN)
BEGIN,
UPDATE TABLE1 SET COLUMN1=1 WHERE COLUMN2 IN (input1,input2);
COMMIT;
END;
and execute this by using executestoredprocedure function
hope this is helpfull
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Venu
over 7 years ago
@Jurim409, I think your A & B values will come form process variables.
You need to convert the array values to single text value using joinarray function.
Joinarray(pv!array,","), map this logic to you ACP (which can be used in sql Query).
example query: SELECT column1 FROM schema.mytableWHERE INSTR(','||ac!value||',', ','||column1||',')>0
Here ACP (ac!value is single type)
Have a look at this news event: https://forum.appian.com/suite/tempo/entry/e-180895
Cancel
Vote Up
+1
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Vinay Kumar Rai
over 7 years ago
Hi @Jurim409, You can use query database smart service
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sparshs
over 7 years ago
You can use a appian plugin for this . In that java code you can use simple jdbc code to update the table values.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
georgej
over 7 years ago
@Jurim409 ,the solution suggested by @venusaikumarc seems to work perfect, you can give it a try
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jurim409
A Score Level 1
over 7 years ago
Hi, I prove to use the solution suggested by @venusaikumarc and it works.
Thanks for all your suggestions.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel