Connecting to Oracle db and fetching SQL queries and executing it and export it to excel

shab1990

New member
Joined
Jan 6, 2023
Messages
3
Programming Experience
3-5
Hi
Scenario - I need to send some 150 reports . At present my old team mate created c# code and created 150 exe with same code.
So in each report folder it have 1sub folder with SQL script another 1cofig file and and exe.

Now it came to me to simplify due to dependency issue.
Now my approach is inserting this SQL in Oracle table as clob. (1 report may have 2 or 3 SQL files and send with different excel )

My approach works correctly if we are sending in 2 differ files.
But some reports it have 2 SQL and reports add in same excel with different sheet. I stuck here.

Here my code looks like.

Connecting to Oracle db
Running that select statement to fetch the SQL query
While(reader)
Assigning columns to different variables here. (Because some report format is csv or Xlsx or text)
Now For loop
 
It's not easy to understand you. Are you asking how to create a second sheet in the same workbook? You haven't even told us the basics such as what libraary youre using to prepare your XLSX file
 
It's not easy to understand you. Are you asking how to create a second sheet in the same workbook? You haven't even told us the basics such as what libraary youre using to prepare your XLSX file
Sorry for this. I'm using Microsoft. Office. Interop. Excel.
My script should able to run on both this scenario. Here scenario I refer is. Same sheet or multiple sheet. This i input in Oracle table.
I use table like.
Report 1 | report name -1 | SQL query (clob)| xlsx | true (same sheet)
Report 1 | report name-2 | SQL query (clob)| xlsx | true (same sheet)

Report 2 | report name -1 | SQL query (clob)| xlsx | true (multiple sheet)
Report 2 | report name-2 | SQL query (clob)| xlsx | true (multiple sheet)



Thanks for the quick reply. Pls let me know if any further input needed. I'm in learning stage so pls pardon me.
 

Latest posts

Back
Top Bottom