Can't insert Data into a database table from an excel sheet


This is the problem i am facing right now.
I am new to uipath and can’t insert data from excel to a table in my database.
i have used insert and configured everything correctly in it by linking it with my database.
but after running the process it is giving me the error like;

  1. Incorrect syntax near keyword ‘From’
  2. Incorrect syntax near ‘21’
  3. Incorrect syntax near ‘by’
1 Like

Hi @diptojyotidutta

Use connect activity and then use insert activity

Thanks
Ashwin.S

You were almost done
The reason is the column name in both DATATABLE and TABLE in DATABASE should be same
—and make sure that there is no space in between the column names in our DATATABLE

if these corrections were made there would no issues

Cheers @diptojyotidutta

Thanks you.
But i have tried using connect activity and then using insert activity but the problem still persists.
@AshwinS2

thank you @Palaniyappan but i had tried that as well but the problem is the same.

Column name in the datatble is the issue
Kindly check that whether they are same as per in database table and make sure that there is no space between column name in both database and n datatable

Cheers @diptojyotidutta

Ok thanks @Palaniyappan i will give it a careful check, i may have missed it.

1 Like

And also make sure that no keyword is used as column name in the datatable
Because it might fail due to that reason as well
Cheers @diptojyotidutta

Ok i will check it as well.
thanks @Palaniyappan

Well now it is working perfectly. It was my mistake regarding the column name.
Well now if i do data scrapping from a website, then can i insert the extracted datatable from the site to the database table using the connect and insert activity because then i will only have concerns with my database table column names and not any excel or CSV file column names, or do i have to do anything in between that?

I would suggest rather changing the column name of database column we can change the column name of datatable that we extract using this expression
Yourdatatablename.Columns(“yourcolumnname”).ColumnName = “Newcolumnname”

This would work either
Cheers @diptojyotidutta

ok thanks @Palaniyappan. I will do the same.

1 Like

@Palaniyappan Can i use special characters such as ‘.’ and ‘&’ in my column names in my tables in the database?

Fine
i would suggest use only _ (underscore) to be used in columnname as it would lead to any mismatch, kindly avoid the other special characters unless needed for
Cheers @diptojyotidutta

2 Likes

thanks for your support @Palaniyappan
i will make sure not to use unnecessary special characters

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