To summarize for all readers I had two problems:
1) first, the number of records retrieved by default when InitialLONGFetchSize = -1.
This first point can be set as proposed by Jörgen with reader.FetchSize = reader.RowSize * N,
with N = 1 for example to process a recording one after the other.
2) the second problem was the size value of the Long raw fields returned by the GetBytes function when InitialLONGFetchSize <> -1.
This is sytematic when I call my stored procedure from my C # code in Visual Studio.
When I replace the call to the procedure with a query defined in my C # code as a string,
I still have the problem with my query if it has a join between 2 tables.
string requeteDocJointUf = "SELECT dj.IDT, dj.NOM_DOC, dj.doc " +
" FROM TB_PAT_DOC_JOINT dj, TB_MVT m " +
" WHERE dj.id_mvt = m.id_mvt " +
" AND m.id_unite_m = '" + scodeUF + "'";
Indeed, looking at reader.GetSchemaTable (), I see that my primary key (dj.IDT) is not recognized as a key
Property: ColumnName Value: IDT
Property: IsUnique Value: False
Property: IsKey Value: False
Property: IsRowID Value: False
On the other hand, if I remove the join then my key is recognized and the GetBytes function returns the size of my binary field.
string requeteDocJointUf = "SELECT dj.IDT, dj.NOM_DOC, dj.doc " +
" FROM TB_PAT_DOC_JOINT dj " +
" WHERE dj.IDT= 274934";
Property: ColumnName Value: IDT
Property: IsUnique Value: True
Property: IsKey Value: True <==
Property: IsRowID Value: False
InitialLONGFetchSize = 0;
int totalBinaryBufferSize = (int)rdr.GetBytes(ordinalBinaire, startIndex, null, 0, 0);
byte[] outByte = new byte[totalBinaryBufferSize];
retval = rdr.GetBytes(ordinalBinaire, startIndex, outByte, 0, totalBinaryBufferSize);
I think that the problem of systematic operation with the procedure may come from the cursor declaration.
I will continue my research, and I will keep you informed if I find the solution with the call to the stored procedure.
To be continued ...
When i remove the join in the cursor of the procedure, my key is still not recognized:
TYPE t_cursor is ref cursor RETURN TB_PAT_DOC_JOINT%ROWTYPE;
PROCEDURE GetAllOnlyForUF(pin_id_unite_m VARCHAR2, cur_docsJoints out t_cursor) IS
BEGIN
OPEN cur_docsJoints FOR SELECT * -- dj.IDT, dj.NOM_DOC, dj.doc
FROM TB_PAT_DOC_JOINT dj
WHERE dj.IDT = 274934;
END GetAllOnlyForUF;