Data Base query to excel File

I want to run the query in the database and show to the output of the query in the Excel file my connection has been established and I am able to insert the values in the database but when i am doing Select * from table name its not showing any data and not giving any output
so how can i insert the data in the excel file

Hi @Jay_Chaudhary ,

Give Timeout for run query. If you have to select huge data. increase your timeout .

Thanks!


Still not working

try adding “;” after the table name and check

Regards

Hi @Jay_Chaudhary ,

Can you try once manually in query editor. if you get table or not.

Can you try to write a excel file for datatable.

Thanks!

I have tried this using write excel file in flow chart but nothing output

Hi @Jay_Chaudhary ,

Can you try once manually in query editor. and pls share the screenshot for that.

Thanks!

I am not able to understand what u want me to do

Pls run your SELECT query manually in DB. and check you can get output or not.

Yes i am getting answer manually but not geting the output in the UiPath

@Jay_Chaudhary

Check below syntax

“SELECT * FROM rpauipath;”

Hope this may help you

Thanks,
Srini

Hi @Jay_Chaudhary
Could u please do a break point after the run querry executes. And show the datatable value in watch panel.so that we can check…
Hope u have completed the basic of DB connections

Thanks
VP

Hi @Jay_Chaudhary

I hope you are doing this way-

  1. Use the connect activity in UiPath to establish a connection to the database. You will need to provide the necessary connection string, username, and password.
  2. Use the Execute Query activity to run your SELECT statement and retrieve the data from the database. The activity will return a DataTable object that contains the results of your query.
  3. Use the Write Range activity to write the data from the DataTable to an Excel file. Specify the range where you want to write the data, as well as the path to the Excel file.

Thanks!!

@Nitya1 @Srini84
the activities execute a query is not available now


in latest updates so what can i use now and the @Srini84 check SQL command its still not giving any output

Hi @Jay_Chaudhary

Firstly can you check if the database connection established sucessfully.

Thanks!!

Yes mam database connection has been established and when i am inserting the data the data is inserted but not able to fetch the data

@Vishnuraj_Pandiyarajan2


sir check whats the eroor

@Jay_Chaudhary

You can’t directly get the data from a datatable like that

You need to have another activity as output Datatable activity, This will convert the Datatable to a String

Then that string you can pass to Messagebox to view the content

Hope this may help you

Thanks,
Srini

thanks for the solution
it worked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.