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
5 subscribers
Views
2282 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hi, I have run the following query in a query node in over 500 process ins
iainf
over 11 years ago
Hi,
I have run the following query in a query node in over 500 process instances without an error:
INSERT INTO tempAbsenceClientUpload SELECT FirstName, LastName, UserID, UserIsActive, Email, TopClient, ClientGroup, isUpdated, MainProcessID, rownumber FROM temporaryAbsClientTable
which simply takes from one table to another.
However, I now get the following error message: 'Subquery returns more than 1 row Error'
Can anyone help me to understand why?
I don't really want alternative code suggestions- just why it happened.
Thanks...
OriginalPostID-77203
OriginalPostID-77203
Discussion posts and replies are publicly visible
Parents
0
Sathya Srinivasan
Appian Employee
over 11 years ago
Is there anything else you're doing in this SQL? If it's a straight-forward Insert statement, it should work irrespective of the no of rows the Select statement returns. So, technically, your sub-select statement can return >1 records and it will be inserted. I think the issue lies in the fact that you are probably using a "=" somewhere that forces the SQL to accept only one record instead of using "IN". I would check that first. Is there a 'Where' clause you have to this SQL? I am assuming you must otherwise running 500 instances of the same sql would only result in duplicates.
In short, if you'r tempAbsentClientUpload can accept multiple records from the temporaryAbsClientTable, check the SQL. On the other hand, if the SQL was designed to only allow one record, then check the data. It's quite likely that you have some duplicate data in your child table.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Sathya Srinivasan
Appian Employee
over 11 years ago
Is there anything else you're doing in this SQL? If it's a straight-forward Insert statement, it should work irrespective of the no of rows the Select statement returns. So, technically, your sub-select statement can return >1 records and it will be inserted. I think the issue lies in the fact that you are probably using a "=" somewhere that forces the SQL to accept only one record instead of using "IN". I would check that first. Is there a 'Where' clause you have to this SQL? I am assuming you must otherwise running 500 instances of the same sql would only result in duplicates.
In short, if you'r tempAbsentClientUpload can accept multiple records from the temporaryAbsClientTable, check the SQL. On the other hand, if the SQL was designed to only allow one record, then check the data. It's quite likely that you have some duplicate data in your child table.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data