How to update db from scraping datatable

Hi,
I’m relatively new to Uipath, and would need some help working with SQL DBs.

Currently I have a problem in loading on DB, a table collected from a scraping, at the beginning of the flow.

my flow collects table DT1, for convenience I have extracted it on Excel.
Elenco.xlsx (8,4 KB)
This table must be overwritten every RUN, so the data can be overwritten every day.

I have to insert the values of the first three columns, on the DB I previously created.
image

Here is my flow, which gives a syntax error in the UPDATE Query.
Bot2.xaml (273,0 KB)

UPDATE DT1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘NumberSort in descending order =‘0410040094’’ at line 1",

Error in this step:
image

Can Help Me?
Thanks…
Aaron

Your insert query is wrong . send me the parameters for the insert query i will fix it.

Hi Ghazanfar…
To explain the flow.
Here, I collect the DT1 table.
image

Elenco.xlsx (8,5 KB)
This is the Excel extraction of table DT1.
It contains several columns, but only the first three are needed.

Then, I assign a variable, to the values of the first column. (PONumber)
image

my query:
“INSERT INTO elenco SET PO NumberSort in descending order =?”
In Collection parameters:
image

(For now, I have only collected data from the first column. Maybe this is where I went wrong.)

On my local server, I preloaded a dummy table. Name of table " elenco".
and I renamed the columns.
image

I also tried lNSERT command, but it doesn’t work.
Same mistake, approx.
image

:expressionless:

“INSERT INTO elenco SET PO NumberSort in descending order =?”

run this query manually in sql. It will throw error.

First create query on sql manually then make it dynamic to use it inside your code.

INSERT INTO elenco SET ‘PO NumberSort in descending order’ = "123123”

I wrote this query, as a test, but, I get the same error, basically.
But I don’t know what he doesn’t like.

OK. Resolved.
Valuable help !! :slight_smile:
I redid the tests on SQL Client … fixed the query … now it’s ok !! :slight_smile:
Thanks so much … really … I was stuck for a few days
I am very inexperienced.
Thanks!
Aaron

run this query manually on sql

INSERT INTO elenco (PONumber) VALUES (123)

lets see it insert data or not

“UPDATE Into elenco (PONumber) VALUES (?)”

All is OK now… thanks!!
I understand… :wink:

UHm… sorry…
I sang victory too soon.
The query inserted (rightly) only the last row of the extracted table.
Actually, I need the whole table on DB to be overwritten with the table collected by the scraping.
Currently consisting of 3 rows … and 3 columns.

image

my table on excel
image

Can help with this step… too… :expressionless:
Thanks…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.