I don't know if this title makes sense, but my situation is as follows:
I'm writing a .Net program to query an Oracle DB for an enormous amount of history (about 2-years worth of daily data) and need to create a delimited text file from this returned query to send through to a client to populate their new database (final file size will be about 4gb).
My current code basically looks as follows:
Dim strSQLQuery as string = (My query to get all the data)
Dim cmd = New OracleCommand(strSQLQuery, conn)
...
Using Reader As OracleDataReader = cmd.ExecuteReader()
... write to text file ...
End Using
This code works great, but my problem is that the query returns such a huge recordset and so I'm afraid of running out of memory on the cmd.ExecuteReader()
statement.
My question is if there is any kind of way in .Net to, rather than process the whole query and return the whole recordset at once, so make the recordset return in more sizable chunks or something like that?
Of course then one solution would be to break up the query itself (which I could do), but I'm also curious to know if there is a better solution already existent in .Net before goign down that route...
Also, although this code is written in VB, I'm equally as comfortable with solutions in either VB or C#.
Thanks!!!