Search code examples
c#odp.net

unknown number of cursors


Using ODP.net, I am calling several stored procedures on 10g. One of the procedures returns one cursor. Another returns three, and yet another returns 11, etc. Is there a way to accommodate an unknown number of cursors. Right now I just add another method that is specific to the need, but this seems like a waste.

I was thinking about storing the number of cursors needed for each procedure, say in an XML file and looping through and adding, but this seems clunkish

Anyone have any ideas?


Solution

  • Odp OracleDataAdapter includes a overload Function Fill that supports Tables array as parameter.

    public int Fill(int startRecord, int maxRecords, params DataTable[] dataTables)
    

    Then you can load many tables from many results.

    You can use also OracleDataReader.NextResult to iterate each Result.