Use variable in 'SQL Query to CSV File'

Discuss RoboTask here
Post Reply
sarnusch
Posts: 69
Joined: Thu Apr 28, 2022 9:05 am

Use variable in 'SQL Query to CSV File'

Post by sarnusch »

Good morning,
I am trying to use a variable ({STORE}) with an integer value in 'SQL Query to CSV File' action.

Screenshot 2025-01-28 105217.png
Screenshot 2025-01-28 105217.png (6.96 KiB) Viewed 63249 times

But it always shows an error:

Screenshot 2025-01-28 105131.png
Screenshot 2025-01-28 105131.png (7.09 KiB) Viewed 63249 times

It seems that variables are not working in 'SQL Query to CSV File' action.
The same setup works fine in 'Dataset Loop' action.
Can you please investigate?
Oleg
Site Admin
Posts: 3309
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Use variable in 'SQL Query to CSV File'

Post by Oleg »

Thank you for the report. It seems this is a bug. We'll fix it
Now you can include RoboTask variables directly in SQL expression
For example:

Code: Select all

select * from addr where locked = {num}
Oleg Yershov
LucasGaines
Posts: 1
Joined: Thu Apr 03, 2025 4:39 am

Re: Use variable in 'SQL Query to CSV File'

Post by LucasGaines »

Has the admin fixed the core yet. My screen still shows the error.
LucasGaines
space waves
Oleg
Site Admin
Posts: 3309
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Use variable in 'SQL Query to CSV File'

Post by Oleg »

LucasGaines wrote: Thu Apr 03, 2025 4:40 am Has the admin fixed the core yet. My screen still shows the error.
This problem has been fixed in version 10.3 (current version)
Oleg Yershov
David Brown1331
Posts: 1
Joined: Sat Jul 25, 2026 9:16 am

Re: Use variable in 'SQL Query to CSV File'

Post by David Brown1331 »

I’m trying to stick a variable ({STORE}) that has just a number into the SQL Query to CSV File action, but it keeps throwing an error no matter what I do. Weird thing is the exact same variable works fine when I use it in Dataset Loop. Not sure if variables just don’t work in that SQL-to-CSV step or if I’m doing something wrong.
Oleg
Site Admin
Posts: 3309
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Use variable in 'SQL Query to CSV File'

Post by Oleg »

Send your task to me in private message or publish the text of your task here.
It's hard to say anything without your task
Oleg Yershov
Post Reply