SQL Write Error

Hello,

I have a sql query as below. I want to replace the text 21 with my previously defined “a” variable. but “” does not allow. How can I do it ?
How can I use my variable in sql. ?

@d.ulutas are you want to place variable “a” in query

Hi @d.ulutas
Place variable like this in place of 21.
‘“+a+”’
you can see I am using so many variable through this method

dont work

“insert Into RobotDb.dbo.EllosEtiket(SiparisNo, SatisKodu, DurumID)
values(‘“+a+”’, 11, 1)”

Run command: Conversion failed when converting the varchar value ‘“+a+”’ to data type int.

Ok got it. You variable is char and but database excepting integer please put like this
‘“+CIn(a)+”’

Hi @d.ulutas,

Try the below expression

"insert into RobotDb.EllosEtiket(SiparisNo, SatisKodu, DurumID) Values (@value1, 11, 1)".Replace("@value1", a)

hi @d.ulutas ,

Please do it this way:

“insert into RobotDb.dbo.EllosEtiket(SiparisNo, SatisKodu, DurumID) values ('”+a+“‘,’”+“11”+“‘,’”+“1”+“')”

Simply copy paste my query as it is then try. Do let me know!

HI @d.ulutas

Can you give a try with this query

insert Into RobotDb.dbo.EllosEtiket(SiparisNo, SatisKodu, DurumID)
values(('"+Variable Name+"'), 11, 1)

Regards
Gokul

Steps to fix-
Open “File Explorer”. Make sure that the “Hidden Items” checkbox under the “View” tab is checked.
Navigate to the “OS(C:)” folder. Open the “ProgramData” folder, open the “Precision Biometrics Inc” folder, and the “MVSW” folder. Right-click the “Temp” folder and select “Properties”.
When the Properties window opens click on the “Security” tab, then click on the “Edit” button.
If “Users” is listed click the “Allow” for “Full control,” then click “OK”.
If “Users” is not listed Click Here to continue troubleshooting.

In the “Select Users or Groups” window, click the “Advanced” button.
Click the “Find Now” button, locate “Users” in the “Search results:”, and click the “OK” button.
You should see “Users” now listed in the “Select Users or Groups” window. Click the “OK” button.
Select “Users” from the list, left-click the “Allow” box for “Full Control” to put a check mark in the box. Then, click the “OK” button.

Regards,
Rachel Gomez