Execute NonQuery issue - quotes

Hi folks !

I am trying to loop excel records and add to SQL database using the Execute NonQuery .

UIPath is complaining when i add this below string in the Input ->SQL

I have added the inputs as parameters …terminalid etc …

I am not sure where to put the quotes seems like UIpath is putting the " at the start and end …

thanks ~!
Mary

“INSERT Into [dbo].[Table] ( [TerminalID] ,
[TerminalDescription] ,
[DriverNumber] ,
[CarrierNumber] ,
[NAME] ,
[CardNumber] ,
[CardSequence] ,
[IssueNumber] ,
[DriverStatus] ,
[PinRequired] ,
[PinCode] ,
[SupplyLockout] ,
[LockoutDate] ,
[LastUpdate] ,
[DefSupplierNo] ,
[DefCustomerNo] ,
[DefAccountNo] ,
[AccessFrom] ,
[AccessTo] ,
[AccessSunday] ,
[AccessMonday] ,
[AccessTuesday] ,
[AccessWednesday] ,
[AccessThursday] ,
[AccessFriday] ,
[AccessSaturday] ,
[ExpirationDate] )
VALUES (’” & TerminalID & “’,’” & TerminalDescription & “’,’” & DriverNumber & “’,’” & CarrierNumber & “’,’” & Name & “’,’” & CardNumber & “’,’” & CardSequence & “’,’” & IssueNumber & “’,’” & DriverStatus &
“’,’” & PinRequired & “’,’” & PinCode & “’,’” & SupplyLockout & “’,’” & LockoutDate & “’,’” & LastUpdate & “’,’” & DefSupplierNo & “’,’” & DefCustomerNo & “’,’” & DefAccountNo & “’,’” & AccessFrom & “’,’” & AccessTo & “’,’” & AccessSunday & “’,’” & AccessMonday & “’,’” & AccessTuesday & “’,’” & AccessWednesday & “’,’” & AccessThursday & “’,’” & AccessFriday & “’,’” & AccessSaturday & “’,’” & ExpirationDate &"’)"

@maryx You can use as shown below query syntax

“Insert into ur_tablename(TerminalID,TerminalDescription,DriverNumber,CarrierNumber)Values(’”+TerminalID +"’,’"+TerminalDescription+"’,’"+DriverNumber+"’,’"+ CarrierNumber +"’)"

Query should be in one line example as shown below

Hi @maryx

I had a similar problem with the NON-Querys. In my case I had to put them into a loop like:

imagen

That’s how i solved that issue, hope it could help you :slight_smile:

Thanks ! I will try + instead of & … those are parameters TerminalID etc

Thanks Pablo ~ Yes I have the same … and have paramters in the query .

Mary

1 Like

Hi Indra,

just a question, I have a sql query that i need to execute using "execute query’ function. As I was executing the said sql statement ,I was able to successfully run it but it shows no results query on UI PATH. So i tried executing it via mysql/dbartisan and found out that it throws 4 result queries. Do i need to write the sql codes in one line so that I will be able to see it displayed successfully ?

image