It appears as though you are iterating through the table in the first picture and overwriting the data in the string variable “PONumber”. In this case the string PONumber would only contain the last number inside of the table, which is why nothing else is updating.
I’m not the best at SQL syntax so I’m sure there is a better solution than the one I am proposing that joins the table all at once. However for it to work in the way you have coded now, the UPDATE DT1 activity needs to be inside of that for each row loop. If you place it inside then it will update each row for the PONumber since it will be iterating through. If the tables are very large though(100, 1000 or even more rows need to update) this will cause the program to be slower than I expect you would want.
If you have a DBA at your company I would suggest reaching out to them to get the syntax for updating a table all at once since the SQL you are using now is for updating rows. If you don’t have one then maybe this link can help guide you?
I’m not sure if the above helps at all, but in either case you are going to have to find an SQL statement that can handle whole table updates.
Thanks Moenk,
OK, the existing table is deleted with Truncate …
My initial problem remains.
Probably due to an incorrect use of the command.
I entered an “execute non query” of uipath, with string:
“INSERT Into list (PONumber, POContactPerson, Offer, LastPing) VALUES (?,?,?,?)”
my problem is that it doesn’t load all the collected table, but only the last row.
I should load the whole table in full.
Can help with this?
Maybe it makes a difference “execute query” versus “execute non query”?
I didn’t understand the difference actually.
Okay, I got another piece of information.
My query only updates one row, because a Where condition is missing, which perhaps is mandatory.
I added a check on “LastPing”, which contains a date field.
I collected the new table from the web.
I added the LastPing column, inserting today’s date.
(date of extraction from the web)
I then created a table on SQL, with identical structure.
Then, I wrote the query:
"UPDATE elenco SET (PONumber, LastPing) =(?,?) Where LastPing != “+now.Tostring(“dd/MM/yyyy”)+” "