Oracle Procedure with IN OUT type as parameter mode.
========================================
- create or replace procedure inout(num in out number)
-
as
-
begin
-
select (sal+nvl(comm,0))*12 into num from emp where empno=num;
-
end;
To call the above Oracle procedure from Vb.
================================
-
'general declaration
-
Dim CON As New ADODB.Connection
-
Dim PR As New ADODB.Parameter
-
Dim PR1 As New ADODB.Parameter
-
-
Private Sub Command1_Click()
-
CON.Open "Provider=MSDAORA.1;Password=DEBASIS;User ID=DEBASIS;Data Source=DAS;Persist Security Info=True"
-
Dim CMD As New ADODB.Command
-
CMD.ActiveConnection = CON
-
CMD.CommandType = adCmdStoredProc
-
CMD.CommandText = "inout"
-
Set PR = CMD.CreateParameter("num", adNumeric, adParamInputOutput, 4, Int(DC1.Text))
-
CMD.Parameters.Append PR
-
CMD.Execute
-
If Not IsNull(CMD.Parameters("num").Value) Then
-
Text1.Text = CMD.Parameters("num").Value
-
Else
-
Text1.Text = ""
-
MsgBox "Data Is Not Available"
-
End If
-
CMD.Cancel
-
CON.Close
-
End Sub