Hi All,
My First post so i hope Im in the right place!

I'm trying to call an oracle stored proc (never done it before) and Im having a spot of bother I've searche dfor a few days and tried various things but nothing seems to work!

The error:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'DRL_BY_DEPT'
ORA-06550: line 1, column 7:

---------------------------------------------------------
Stored Proc is:

Stored procedure name: drl_by_dept
Oracle Package pmc_pkg
Data Type Length
Input Parameters p_start_dt The start date of the DRL calculation period. VARCHAR2
MM/DD/YYYY 10
p_end_dt The end date of the DRL calculation period. VARCHAR2
MM/DD/YYYY 10
p_shift_cd The shift code of the DRL calculation period. NCHAR 1
Output Parameters p_bpd_nm The department name VARCHAR2 30
p_defect_cnt Sum of DRL_RATIO INT
p_target The DRL target value for the period. NUMBER (5,2)
p_drl Direct Run Loss (DRL) NUMBER (6,2)
p_veh_cnt Number of vehicles inspected at the DRL count point during calculation period. INT


Hope that looks better when I submit the thread now for my code:-


Sub TestProcOracle(ByVal connectionString As String)

'Using connection As New SqlConnection(connectionString)
Using connection As New OracleConnection(connectionString)
' Create the command and set its properties.
'Dim command As SqlCommand = New SqlCommand()
Dim command As OracleCommand = New OracleCommand
command.Connection = connection
command.CommandText = "pmc_pkg.drl_by_dept"
command.CommandType = CommandType.StoredProcedure

' Add the input parameter and set its properties.
'Dim parameter As New SqlParameter()
Dim parameter As New OracleParameter
parameter.ParameterName = "p_start_dt"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter.OracleType = OracleType.VarChar
parameter.Direction = ParameterDirection.Input
parameter.Value = "02/11/2009"
parameter.Size = 10

' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter)

Dim parameter2 As New OracleParameter
parameter2.ParameterName = "p_end_dt"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter2.OracleType = OracleType.VarChar
parameter2.Direction = ParameterDirection.Input
parameter2.Value = "02/11/2009"
parameter2.Size = 10

' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter2)

Dim parameter3 As New OracleParameter
parameter3.ParameterName = "p_shift_cd"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter3.OracleType = OracleType.NChar
parameter3.Direction = ParameterDirection.Input
parameter3.Value = "A"
parameter3.Size = 1
' parameter3.OracleType = OracleType.Cursor
' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter3)

Dim parameter4 As New OracleParameter
parameter4.ParameterName = "p_bpd_nm"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter4.OracleType = OracleType.VarChar
parameter4.Direction = ParameterDirection.Output
parameter4.Size = 30
parameter4.OracleType = OracleType.Cursor
' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter4)

Dim parameter5 As New OracleParameter
parameter5.ParameterName = "p_defect_cnt"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter5.OracleType = OracleType.Int32
parameter5.Direction = ParameterDirection.Output
'parameter4.Value = "A"
parameter5.OracleType = OracleType.Cursor
' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter5)

Dim parameter6 As New OracleParameter
parameter6.ParameterName = "p_target"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter6.OracleType = OracleType.Number
'parameter6.OracleType = OracleType.NChar
parameter6.Direction = ParameterDirection.Output
'parameter4.Value = "A"
parameter6.OracleType = OracleType.Cursor
' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter6)


Dim parameter7 As New OracleParameter
parameter7.ParameterName = "p_drl"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter7.OracleType = OracleType.Number
parameter7.Direction = ParameterDirection.Output
'parameter4.Value = "A"
parameter7.OracleType = OracleType.Cursor
' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter7)

Dim parameter8 As New OracleParameter
parameter8.ParameterName = "p_veh_cnt"
'parameter.SqlDbType = SqlDbType.NVarChar
parameter8.OracleType = OracleType.Int32
parameter8.Direction = ParameterDirection.Output
'parameter4.Value = "A"
parameter8.OracleType = OracleType.Cursor
' Add the parameter to the Parameters collection.
command.Parameters.Add(parameter8)

'Dim param1 As OleDbParameter = New OleDbParameter("pi_table", OleDbType.VarChar, 100)
'param1.Direction = ParameterDirection.Input

'SqlCommand.SelectCommand.Parameters.Add(param1).V alue = "prx_bpm_index"
'Dim param2 As OleDbParameter = New OleDbParameter("pi_string", OleDbType.VarChar, 500)
'param2.Direction = ParameterDirection.Input
'SqlCommand.SelectCommand.Parameters.Add(param2).V alue = querystr
'Dim param3 As OleDbParameter = New OleDbParameter("pi_max", OleDbType.Integer)
'param3.Direction = ParameterDirection.Input
'SqlCommand.SelectCommand.Parameters.Add(param3).V alue = 6
'Dim param4 As OleDbParameter = New OleDbParameter("po_status_code", OleDbType.Integer)
'param4.Direction = ParameterDirection.Output
'SqlCommand.SelectCommand.Parameters.Add(param4)


'command.Parameters.Add(New OracleParameter("p_start_dt", OracleType.VarChar, 10)).Value = Date.Today
'command.Parameters.Add(New OracleParameter("p_end_dt", OracleType.VarChar, 10)).Value = Date.Today
'command.Parameters.Add(New OracleParameter("p_shift_cd", OracleType.NChar, 1)).Value = "A"
'command.Parameters.Add(New OracleParameter("p_shift_cd", OracleType.NChar, 1))

' Open the connection and execute the reader.
connection.Open()

'From here we will use the dataadapter and the dataset
'Dim myAdapater As SqlDataAdapter = New SqlDataAdapter(command)
Dim myAdapater As OracleDataAdapter = New OracleDataAdapter(command)

Dim myDataSet As New DataSet
'Fill the dataset
myAdapater.Fill(myDataSet)
'bind the dataset to the datagrid
Me.DataGridView1.DataSource = myDataSet.Tables(0)


'Dim reader As SqlDataReader = command.ExecuteReader()
Dim reader As OracleDataReader = command.ExecuteReader()
If reader.HasRows Then
Do While reader.Read()
MsgBox(reader(0))
MsgBox(reader(1))
MsgBox(reader(2))
''Console.WriteLine("{0}: {1:C}", _
''reader(0), reader(1))
Loop
Else
MsgBox("No rows returned.")
End If

connection.Close()
End Using
end sub

There's alot of commented stuff in there from trial n error....lol

Thanx

Terry