oracle procedure out parameter and visual basic [message #206251] |
Wed, 29 November 2006 05:45 |
soujanya_srk
Messages: 111 Registered: November 2006 Location: HYDERABAD
|
Senior Member |
|
|
yesterday I have posted a doubt where I used a procedure with
in parameters to insert in a table, and called it from
visual basic
today, to learn more, i tried to use out parameters..but i am
getting error
the procedure is
1 create or replace procedure apmc_sel(p_id in apmc.dno%type,
2 p_name out apmc.dname%type)
3 as
4 begin
5 select dname into p_name from apmc where dno=p_id;
6* end;
and the code in visual basic, this is public procedure
which i am calling at a button click
Public Sub MYPROC()
Dim STR As String
'
With p1
.Direction = adParamInput
.Type = adNumeric
.Value = Form1.Text1.Text
End With
With p2
.Direction = adParamOutput
.Type = adBSTR
End With
With Q1
.CommandText = "SCOTT.APMC_PROC"
.CommandType = adCmdStoredProc
.ActiveConnection = con
.Parameters.Append p1
' .Parameters.Append p2
End With
Q1.Execute (error here)
MsgBox "procedure executed", vbInformation
End Sub
i am getting an error saying wrong number of arguments in
call to procedure....
which means i have to do something with the out parameter
the procedure is simple...just passing in an id, and getting
the name...i think after that its upto us what to do
with that value...whether we want to display it, or store
it somewhere else....
my question is, how to get that out parameter value?
|
|
|
|
|
|