Oracle 8i, OleDB driver and Batch Queries

F

fabrice

Hello

Is it possible to execute Batch Queries with Oracle and the driver OleDB. I
don't managed to do it.
My ConnectionString :
...value="Provider=OraOLEDB.Oracle; Data Source=MYBASE; User ID=USER;
Password=PASSWORD"

Here is my code,
--- This part is running, there is only one request.

Dim mySQL As String = "SELECT CHAMP1? CHAMP2 FROM MATABLE" _
& "WHERE MATABLE.IDE = ?"
Dim myOleDbCmd as New OleDbCommand (mySQL,myOleDbConn)

myOleDbCmd.Parameters.Add(New OleDb.OleDbParameter("ide", intIde))

Dim myReader As OleDbDataReader = myOleDbCmd.ExecuteReader()

But if i want to try that,

Dim mySQL As String = "SELECT CHAMP1? CHAMP2 FROM MATABLE" _
& "WHERE MATABLE.IDE = ?;SELECT COUNT(*) FROM MATABLE"

I get error ORA-0911 invalid Caracter. The problem seem to be the caracter ;


Thanks a lot for your help
fabrice
 
P

Paul Clement

¤ Hello
¤
¤ Is it possible to execute Batch Queries with Oracle and the driver OleDB. I
¤ don't managed to do it.
¤ My ConnectionString :
¤ ..value="Provider=OraOLEDB.Oracle; Data Source=MYBASE; User ID=USER;
¤ Password=PASSWORD"
¤
¤ Here is my code,
¤ --- This part is running, there is only one request.
¤
¤ Dim mySQL As String = "SELECT CHAMP1? CHAMP2 FROM MATABLE" _
¤ & "WHERE MATABLE.IDE = ?"
¤ Dim myOleDbCmd as New OleDbCommand (mySQL,myOleDbConn)
¤
¤ myOleDbCmd.Parameters.Add(New OleDb.OleDbParameter("ide", intIde))
¤
¤ Dim myReader As OleDbDataReader = myOleDbCmd.ExecuteReader()
¤
¤ But if i want to try that,
¤
¤ Dim mySQL As String = "SELECT CHAMP1? CHAMP2 FROM MATABLE" _
¤ & "WHERE MATABLE.IDE = ?;SELECT COUNT(*) FROM MATABLE"
¤
¤ I get error ORA-0911 invalid Caracter. The problem seem to be the caracter ;
¤

No way to do this w/o a stored procedure that I am aware of. AFAIK you need to return ref cursors as
parameters from an Oracle SP in order to get this to work:

See the section titled "Working with Multiple Result Sets" at the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/msdnorsps.asp


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Top