theAsocialApe
Member
- Joined
- Mar 21, 2008
- Messages
- 13
- Programming Experience
- 5-10
does anyone know how to call an oracle procedure without the parametername?
----
We've got some oracle packages that take like 15 parameters. I'm sick of doing this
and then typing
etc for fifteen values.
I'm trying to make an oracleparameter maker function like
where I can just give a textbox like
But it's failing on calling the procedure or package because that function doesn't add the OracleParameter.ParameterName, either in the constructor or just explicitly when it's adding the value and type and stuff.
I know that the f(x) needs a lot more work to do it's job, but I'm just wanting to get a flimsy little thing working so I can see if there's any point in continuing.
----
We've got some oracle packages that take like 15 parameters. I'm sick of doing this
VB.NET:
Dim pc As New OracleParameterCollection
and then typing
VB.NET:
Dim a As New OracleParameter("p1", OracleType.Number)
a.Direction = Data.ParameterDirection.Input
a.Value = tb1.Text.Trim
pc.Add(a)
Dim b As New OracleParameter("p2", OracleType.Number)
b.Direction = Data.ParameterDirection.Input
b.Value = tb2.Text.Trim
pc.Add(a)
I'm trying to make an oracleparameter maker function like
VB.NET:
Private Function tb2OraParam(ByVal tb As TextBox) As OracleParameter
Dim a As New OracleParameter
Dim theInt As Integer
Dim theDate As Date
a.Direction = Data.ParameterDirection.Input
If Integer.TryParse(tb.Text.Trim, theInt) Then
a.OracleType = OracleType.Number
a.Value = theInt
ElseIf Date.TryParse(tb.Text.Trim, theDate) Then
a.OracleType = OracleType.DateTime
a.Value = tb.Text.Trim
Else
a.OracleType = OracleType.VarChar
a.Value = tb.Text.Trim
End If
Return a
End Function
VB.NET:
pc.Add(tb2OraParam(tb1))
But it's failing on calling the procedure or package because that function doesn't add the OracleParameter.ParameterName, either in the constructor or just explicitly when it's adding the value and type and stuff.
I know that the f(x) needs a lot more work to do it's job, but I'm just wanting to get a flimsy little thing working so I can see if there's any point in continuing.