我有一些存储过程可以执行,用于dbms_output.put_line()
将数据放入输出缓冲区。
我知道我需要用来dbms_output.get_line(:line, :status)
检索该输出。我System.Data.OracleClient
用来避免 Oracle 部署的麻烦。
那么我在下面的代码中做错了什么?
Dim cmdSproc As OracleCommand = cnOracle.CreateCommand()
Dim strOracle As New OracleString()
Dim opaLine As New OracleParameter("lineOut", OracleType.VarChar, 255)
opaLine.Direction = ParameterDirection.Output
Dim opaStatus As New OracleParameter("status", 0)
cmdSproc.CommandText = "begin dbms_output.get_line(:lineOut,:status); end;"
cmdSproc.Parameters.Add(opaLine)
cmdSproc.Parameters.Add(opaStatus)
Dim strOutput As String = ""
strOracle = "0"
Try
While strOracle = "0"
cmdSproc.ExecuteOracleNonQuery(strOracle)
strOutput = strOutput & strOracle.ToString() & vbNewLine
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try