Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use OracleCommand.Fetchsize to improve perfomance on large Queries.</p> <pre><code>cmd.FetchSize = &amp;H100000 '1Mb Dim Rdr = cmd.ExecuteReader </code></pre> <p>Some time ago, I use Async Readers for get Blob Data. But to use Async Reader you need maintain an array with each async Result an loop until last Reader ends.</p> <pre><code> Public Shared Function FromBlob(ByVal Id As String, ByVal Rv As String, ByVal cn As OracleConnection) As Proyecto Dim n As Integer, Prj As Proyecto = Nothing Dim Bf(2)() As Byte, arrAr(2) As IAsyncResult 'Para proceso asíncrono Dim Cmd As New OracleCommand( _ "Select rv,fecha,Datos From Proyectos Where Id=:Id and Rv in (:Rv,'Av','Est')", cn) Cmd.BindByName = True Cmd.Parameters.Add("Id", OracleDbType.Varchar2, Id, ParameterDirection.Input) Cmd.Parameters.Add("Rv", OracleDbType.Varchar2, Rv, ParameterDirection.Input) If Rv Is Nothing Then Prj = Proyecto.Actprj Try Using Rdr As OracleDataReader = Cmd.ExecuteReader Do Until Rdr.Read = False Dim rv1 As String = Rdr.GetString(0) Select Case rv1 Case "Av" : n = 1 'Avance TND Case "Est" : n = 2 'Datos Seguimiento Estudio Seguridad Case Else : n = 0 End Select If Rdr.IsDBNull(2) = False Then Dim Blob As OracleBlob = Rdr.GetOracleBlob(2) Dim Buffer(CInt(Blob.Length)) As Byte Bf(n) = Buffer arrAr(n) = Blob.BeginRead(Buffer, 0, Buffer.Length, Nothing, Blob) End If Loop If Bf(0) Is Nothing AndAlso Prj Is Nothing Then _ MessageBox.Show("Fallo al cargar proyecto") : Return Nothing For n = 0 To Bf.Length - 1 Dim ar As IAsyncResult = arrAr(n) If ar IsNot Nothing AndAlso ar.AsyncWaitHandle.WaitOne() Then Dim blob As OracleBlob = DirectCast(ar.AsyncState, OracleBlob) blob.EndRead(ar) blob.Dispose() If ar.IsCompleted Then Using rd As New BinReader(New MemoryStream(Bf(n))) If n = 0 Then Prj = New Proyecto(rd, False) Else Dim entry = Proyecto.Entry.FromLob(rd), Index = Prj.IndexOf(entry) If Index &lt; 0 Then Prj.Add(entry) Else Prj(Index) = entry End If End Using End If End If Next End Using Catch ex As Exception MessageBox.Show(ex.Message) End Try Return Prj End Function </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload