Article ID: 183639
Article Last Modified on 6/29/2004
A cursor is a synonym for context area - a work area in memory where Oracle stores the current SQL statement. For a query, the area in memory also includes column headings and one row retrieved by the Select Statement.
Create Or Replace Procedure NoTable
(inNum IN NUMBER, outNUM OUT NUMBER)
IS
BEGIN
outNUM := inNUM/2;
END;
/
'
Dim strSql As String
Dim strError As String
Dim En As rdoEnvironment
Dim Qr As rdoQuery
Dim Cn As rdoConnection
Dim Rs As rdoResultset
Dim strCon, UserID As String
Private Sub Command1_Click()
strCon = "DSN=MyOracle;UID=MyUID;PWD=MyPassword;"
strSql = "{call NoTable(?,?)}"
Set En = rdoEnvironments(0)
En.CursorDriver = rdUseClientBatch
Set Cn = En.OpenConnection("", rdDriverNoPrompt, _
False, strCon)
'Pause the program to check on number of open cursors.
'Should be 0 (zero) at this point
MsgBox "Check Open Cursors"
Set Qr = Cn.CreateQuery("", strSql)
Qr.rdoParameters(0).Value = 10
Qr.Execute
'Pause the program to check on number of open cursors.
'Should be three at this point.
MsgBox "Check Open Cursors"
Debug.Print "The Output is " & Qr(1)
Qr.Close
'Should be two open cursors at this point.
MsgBox "DONE"
End Sub
Keywords: kboracle kbapi kbprb kb3rdparty KB183639