Issue with database queries


#1

“LOAD DATA LOCAL INFILE ‘(filepath)’ INTO TABLE test FIELDS TERMINATED BY ‘,’ enclosed by ’ " ’ LINES TERMINATED BY ‘\r\n’ ignore 1 lines (id , name, @var1) set date = STR_TO_DATE(@var1, ‘%Y-%m-%d’);”

while trying to execute this query, UIPath is assuming the double qoutes (") next to ‘enclosed by’ as the end of the query and throwing an error which says,end of expression expected. Kindly help me on how I can resolve this. I tried escaping ’ /" ’ which didn’t work.

Thank you
Amitha


#2

Did you try replacing with char(34)?


#3

This is again throwing an error that says, “fatal error occured while executing the query.”


#4

I think its chr(34) in vb.net. Give a try.


#5

“LOAD DATA LOCAL INFILE ‘(File Path)’ INTO TABLE test FIELDS TERMINATED BY ‘,’ enclosed by '”+chr(34)+"’ LINES TERMINATED BY ‘\r\n’ ignore 1 lines (id , name,date);

This worked. Thank you :slight_smile: