Oracle Objects for OLE
Release 9.2

Part Number A95895-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback

Executing Multiple Queries in Asynchronous Mode

Multiple queries can be executed in asynchronous mode. In this example, the second connection executes a SQL statement in blocking mode while the first is executing a non-blocking call.

Dim OraSess as OraSession

Dim OraServ as OraServer

Dim OraDb1 as OraDatabase

Dim OraDb2 as OraDatabase

Dim OraStmtnonblk as OraSQLStmt

Dim OraStmtblk as OraSQLStmt

Dim stat as long

set OraSess = CreateObject("OracleInProcServer.XOraSession")

set OraDb1 = OraSess.OpenDatabase("exampledb","scott/tiger",0&)

Set OraServ = CreateObject("OracleInProcServer.XOraServer")

set OraDb2 = OraServ.OpenDatabase("exampledb","scott/tiger",0&)

'execute the select statement with NONBLOCKING mode on

set OraStmtnonblk = OraDb1.CreateSQL ("update emp set sal = sal + 1000", ORASQL_NONBLK)

'Check if the call has completed

stat = OraStmt.NonBlockingState

while stat = ORASQL_STILL_EXECUTING

MsgBox "Asynchronous Operation under progress"

stat = OraStmt.NonBlockingState

wend

MsgBox "Asynchronous Operation completed successfully"

'execute on the second connection in BLOCKING mode

set OraStmtblk = OraDb2.CreateSQL ("update emp set sal = sal + 500",0&)


 
Oracle
Copyright © 1994, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback