我遇到了ASP 2005应用程序的问题,问题是我在Oracle中调用存储过程保存在一个包上,该过程非常繁重(有1000行),最后插入在表格中只有calcutaded的数据,然后在其他vb函数中我从该表中获取信息并在gridview上显示它,但是计算的2列有时会带有值0,有时会带有值应该是。这只发生在我从asp调用precedure时,当我从Toad运行它时,它总是在那些列上得到值...你知道会发生什么吗?
这是我用来发送参数的函数:
Private Function LoadTable(ByVal tipee As String, ByVal period As String, ByRef ErrorUser As String, ByVal dateInit As String, ByVal dateEnd As String) As Boolean
Dim cmd As New OracleCommand
cmd.CommandText = "Schema.PKG.procedureA"
cmd.CommandType = CommandType.StoredProcedure
Dim Prmts(6) As OracleClient.OracleParameter
Prmts(0) = New System.Data.OracleClient.OracleParameter("ptipotrans", OracleType.VarChar)
Prmts(0).Value = tipee
Prmts(1) = New System.Data.OracleClient.OracleParameter("pperiodo", OracleType.VarChar)
Prmts(1).Value = period
Prmts(2) = New System.Data.OracleClient.OracleParameter("pfechaini", OracleType.VarChar)
If dateInit = "" Then
Prmts(2).Value = DBNull.Value
Else
Prmts(2).Value = dateInit
End If
Prmts(3) = New System.Data.OracleClient.OracleParameter("pfechafin", OracleType.VarChar)
If dateEnd = "" Then
Prmts(3).Value = DBNull.Value
Else
Prmts(3).Value = dateEnd
End If
Prmts(4) = New System.Data.OracleClient.OracleParameter("perror", OracleType.VarChar, 100)
Prmts(4).Direction = ParameterDirection.Output
cmd.Parameters.Clear()
For i As Integer = 0 To 4
cmd.Parameters.Add(Prmts(i))
Next
Dim cls_sql As New cls_ejecutaSql
Return cls_sql.exec_ens(cmd, errorUser)
End Function
这是我用来连接Oracle的函数:
Public Function exec_ens(ByVal cmd As OracleCommand, ByRef msg As String) As Boolean
Dim lint_resul As Boolean
con.Open()
cmd.Connection = con
Try
cmd.ExecuteNonQuery()
lint_resul = True
Catch ex As Exception
msg = cmd.Parameters("perror").Value
lint_resul = False
Finally
con.Close()
End Try
Return lint_resul
End Function
我在这些功能中没有看到任何异常,我也确认参数发送良好