Hello, I have a question about SQL.
I want to print my SQL outputs to Excel using the values in my Output Excel(year,colour,gearbox_types)
Output.xlsx (9.2 KB)
Hello, I have a question about SQL.
I want to print my SQL outputs to Excel using the values in my Output Excel(year,colour,gearbox_types)
Use Write Range activity to write Data Table output you would receive from Execute Query activity.
Thanks,
Ashok ![]()
It will read each row, write it to the query one by one, and then write it. How can I do this?
In that case use Append Range activity. This will write the new data below the last row.
Thanks,
Ashok ![]()
For example: select * from ARBOR.TMP_CBU_CAR
where YEAR in (‘1.01.2021’)
and COLOR in (‘Orange’)
then
select * from ARBOR.TMP_CBU_CAR
where YEAR in (‘1.01.2008’)
and COLOUR in (‘White’)
and GEARBOX_TYPES in (‘Automatic’)
How can I update the query?
Do you mean these ‘White’, ‘Automatic’, ‘1.01.2008’ you want to make it dynamic?
Yes,it is dynamic.

In the query, first the 3rd line will be updated and the result will be written to d3 and e3. Then a4, b4 and c4 will be updated in the query respectively and written to d4 and e4. And this will continue until the end of the line.
Follow these steps:
dtInput"select * from ARBOR.TMP_CBU_CAR
where YEAR in (‘"+CurrentRow.Item("YEAR").ToString+"’)
and COLOUR in (‘"+CurrentRow.Item("COLOUR").ToString+"’)
and GEARBOX_TYPES in (‘"+CurrentRow.Item("GEARBOX").ToString+"’)"
Sample workflow:
Workflow2.xaml (9.3 KB)
Thanks,
Ashok ![]()
looks like single quotes are wrong…can you try this
"select * from ARBOR.TMP_CBU_CAR
where YEAR in ('"+CurrentRow.Item("YEAR").ToString+"')
and COLOUR in ('"+CurrentRow.Item("COLOUR").ToString+"')
and GEARBOX_TYPES in ('"+CurrentRow.Item("GEARBOX").ToString+"')"
cheers
can you please print this value and check how it looks…we can format accordingly
use a log message with CurrentRow.Item("YEAR").ToString
cheers
It’s a data issue. Check if your data for month is correctly passed.
Thanks,
Ashok ![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.