I was going to insert data table to sql database using insert activity.
Table headers have spaces. If it is a 3 word header, second space is not recognized by the UI Path.
it gives an error “'illegal syntax before the word ‘xxx’”
Hey!
If you give the space in SQL. next to the space it is considered as DataTyope…
It shouldn’t accept the spaces in the syntax
Syntax:
Create table sample(ColumnName dataType);
Correct_Example:
Create table sample(ABC Varchar(255));
In_Correct_Example:
Create table sample(AB C Varchar(255));
Regards,
NaNi
Dear Thiru,
Thank you very much for your response. Kindly check below snips. It recognize the first header. It has a space.
But second header, it has two spaces. second space did not recognized.
Is there way to use, at least using run query activity in a foreach row in data table activity. will it possible?
Hey!
It’s strange how the first header recognized?
it won’t recognize the spaces in between the text…
Try like this:
Notify_Party
Prepaid_or_Collect
OR
NotifyParty
PrepaidOrCollect
You have to declare the Headers like this…
Kindly, Change the headers…
This will work for sure
Regards,
NaNi
Dear Thiru,
Yes, when I change the headers, it work. I’m finding a solution to use with headers. If I change headers only for this, that will effect so many other processes which are using that sql table
Thank you,
Ruvinda
Hey!
use temp data table… i.e., Build DataTable
and create the columns use bulk insert and provide the dt
regards,
NaNi
instead of space you can give underscore then it will work
Hello @Ruvinda_Nilakshika It looks like the columns should not contains any or keywords. Try to remove OR and see how it goes. Ref below post
Dear Thiru,
Not in UI path processes. That sql DB can not change, it is used by processes like Power BI report generation kind of things.
Thank you
Hey!
Got it…
Either we have to change/Update the Headers in Sql or we have to create the new data table…
I think we can get the data from sql and then only we can generate the reports in PowerBi.
We can change the headers in sql. The live data will affect on the PowerBi Template as well…
it won’t affect anything…
Regards,
NaNi
Hello Ushu and Thiru,
Thank you very much for the support. We can go with removing spaces in headers.
Thank you,
Ruvinda
Hey!
Glad to hear that…
Mark the appropriate post as solution and close the thread…
Happy Automation
Regards,
NaNi
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.