Skip to content
Advertisement

How to use multiple select queries inside c# by oracle

I need to select multiple select queries inside the C# code block. when I use it, I am getting an error such as an invalid character. I got that it is an error by using a semicolon inside the queries, Is there any solution for selecting multiple select queries?

I am using Oracle.ManagedDataAccess ExecuteReader for executing the query.

Query :

I am getting this error as

Oracle.ManagedDataAccess.Client.OracleException: ‘ORA-00911: invalid character

If I removed the semicolon then the error changes as

statement are not terminated properly

Advertisement

Answer

Since both queries return scalar values, you can combine them as

and read POCount and ASNCount fields. Please, note that Oracle uses : for parameters, something like this:

Another (more general) possibility is using cursors and NextResult:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement