C
csidb
We have a new Oracle DB with stored procedure:
xxcus_test.product (p_number1 in NUMBER,
p_number2 in NUMBER,
x_result out number)
I wrote the following VB code to call it, but it fails on "Execute". Can
anyone see what is wrong?
-----------------------------------------------------------
Option Compare Database
Private Sub Command0_Click()
Me.Text5 = GetTotal()
End Sub
Function GetTotal() As Long
Dim db As Database
Dim LSProc As QueryDef
Dim LSQL As String
Dim p_number1 As Integer
Dim p_number2 As Integer
Dim x_result As Integer
p_number1 = 1
p_number2 = 2
x_result = 0
On Error GoTo Err_Execute
Set db = CodeDb()
Set LSProc = db.CreateQueryDef("")
LSProc.Connect = "ODBC;DRIVER={Oracle in
XE};SERVER=CONV;UID=apps;PWD=apps;DBQ=CONV;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=Me;CSR=F;FWC=F;FBS=60000;TLO=O;"
LSProc.SQL = "BEGIN xxcus_test.product(" & p_number1 & "," & p_number2 &
"," & x_result & "); END;"
LSProc.ReturnsRecords = False
LSProc.ODBCTimeout = 100
LSProc.Execute
Set LSProc = Nothing
GetTotal = x_result
Exit Function
Err_Execute:
MsgBox "The call to the Oracle stored procedure failed."
GetTotal = -1
End Function
xxcus_test.product (p_number1 in NUMBER,
p_number2 in NUMBER,
x_result out number)
I wrote the following VB code to call it, but it fails on "Execute". Can
anyone see what is wrong?
-----------------------------------------------------------
Option Compare Database
Private Sub Command0_Click()
Me.Text5 = GetTotal()
End Sub
Function GetTotal() As Long
Dim db As Database
Dim LSProc As QueryDef
Dim LSQL As String
Dim p_number1 As Integer
Dim p_number2 As Integer
Dim x_result As Integer
p_number1 = 1
p_number2 = 2
x_result = 0
On Error GoTo Err_Execute
Set db = CodeDb()
Set LSProc = db.CreateQueryDef("")
LSProc.Connect = "ODBC;DRIVER={Oracle in
XE};SERVER=CONV;UID=apps;PWD=apps;DBQ=CONV;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=Me;CSR=F;FWC=F;FBS=60000;TLO=O;"
LSProc.SQL = "BEGIN xxcus_test.product(" & p_number1 & "," & p_number2 &
"," & x_result & "); END;"
LSProc.ReturnsRecords = False
LSProc.ODBCTimeout = 100
LSProc.Execute
Set LSProc = Nothing
GetTotal = x_result
Exit Function
Err_Execute:
MsgBox "The call to the Oracle stored procedure failed."
GetTotal = -1
End Function