can i have a screesshot of where this expression is mentioned that is in the editable area because we can find the red curly marks with which we can identify where we want to add the comma @hss
@hss - I’d start with some basic troubleshooting - First try removing all variables and hardcode to see if it is working. If it is working, then add in one variable at a time and re-run until you get it working with all of the variables/paramaters
@hss - i copy + pasted your code from the original post and it looks like the incorrect “double quote” character is being used, that is what is causing at least some of your issues. You can tell immediately within your screenshot as well since the correct double quote will change the color of the text when you’re working in uipath
EDIT: Here is your original post with the correct ‘single’ and “double” quotes. Note that I didn’t check the syntax or anything else, just that the correct quotes are being used:
"insert into table_name(col1,col2,col3,col4,col5,create_date,created_by) values (00,0,'"+variable_1+"','"+system.Environment.UserName+"','New’,'"+"TO_DATE('23-04-49 20:18:07"+"','"+"DD-MM-YY HH24:MI:SS')"+"','"+system.Environment.MachineName+"')"
@hss and @Palaniyappan - New is indeed a keyword, but it should not be in brackets, that is only for column names/headers. This is a string value, so you fix it by enclosing within ‘single quotes’ which has already been done
@hss - i have copied + pasted into a text editor and am putting everything onto it’s own line like I’d normally write out a SQL query which i’ve found to be very helpful. What is the expected format of the TO_Date portion? Is that a date field within your oracle db? Everything up to the ‘system.environment.username’ portion is working correctly. There is an extra comma and some single quotes in that area that is causing issues but i can’t recommend a solution as I’m not sure what field type you are trying to insert (i’m guessing date field, but I can’t remember PL/SQL syntax all that well)
EDIT: Here it is so it’ll actually work in uipath (removed all newline): "insert into table_name(col1,col2,col3,col4,col5,create_date,created_by)values(00,0,'"+variable_1+"','"+system.Environment.UserName+"','New’,TO_DATE('23-04-49 20:18:07','DD-MM-YY HH24:MI:SS'),'"+system.Environment.MachineName+"')"
@hss - can you run it in PL/SQL developer or other tool? That will give us better information haha. So you don’t have to re-write it, just write the query to .txt file using the robot, then copy+paste from the text file into PL/SQL and can just click run.
@Dave thank u so much for your quick responses, indeed helped me a LOT
The query worked. I am mentioning the mistakes i was doing while writing them:
2nd statement is the correct working statement. Indicating by arrows and numbers
Full Query is here: "insert into table_name(col1,col2,col3,col4,col5,create_date,created_by) values(00,0,'"+variable_1+"','"+system.Environment.UserName+ "','New',TO_DATE('23-04-49 20:18:07','DD-MM-YY HH24:MI:SS'),'" +system.Environment.MachineName+"')"