Slotty
Slotty

Reputation: 174

Pulling back multiple queries in a single call to fill a Dataset from Oracle

I have an application that supports both SQL Server and Oracle as the back end database.

On SQL Server I can add two queries into a single ODBCommand string and when it runs it Fills a Dataset, creating two DataTables in the Dataset, one for each of the queries.

string command = "SELECT * FROM TABLE1 SELECT * FROM TABLE2"    

var dbConnection = GetOdbcConnection();

var dataAdapter = new OdbcDataAdapter(completeSqlString, dbConnection);
dataAdapter.Fill(dataSet);

However, this won't work against the Oracle back end. I get an error

ORA-00911: invalid character error.

But both queries work in SQL Developer.

I have added the ; to show the end of one query, I have tried wrapping both the queries in a BEGIN...END But it's not working. Everything I find on line is about retrieving one datapoint from each of the queries and selecting that into a variable.

Is this possible? What do I need to do to make it work?

Thanks in advance.

Upvotes: 1

Views: 161

Answers (0)

Related Questions