My server ( Oracle 9i (10g) ) has the following stored procedure
CREATE OR REPLACE PACKAGE PKG IS
TYPE SELCUR IS REF CURSOR;
procedure get_data(datebegin in date, dateend in date, c1 out selcur);
END PKG;
CREATE OR REPLACE PACKAGE BODY PKG IS
procedure get_data(datebegin in date, dateend in date, c1 out selcur) as
begin
open c1 for
select charge from t where (t.db > datebegin and t.db
OraSession := TOraSession.Create(nil);
OraSession.ConnectString := 'eacnew/[email protected]:1521:orcl';
OraSession.Options.Net := True;
OraStored := TOraStoredProc.Create(nil);
OraStored.Session := OraSession;
OraStored.StoredProcName := 'eacnew.pkg.get_data';
i := 0;
while i < 1000 do begin
Memo1.Lines.Add(' i = ' + IntToStr(i));
OraStored.Prepare;
OraStored.ParamByName('datebegin').AsDateTime := EncodeDate(2005, 12, 1) + i;
OraStored.ParamByName('dateend ').AsDateTime := EncodeDate(2005, 12, 2) + i;
OraStored.Execute;
while not OraStored.Eof do begin
Memo1.Lines.Add(IntToStr(i) + ' ' + OraStored.FieldByName('charge').AsString);
OraStored.Next;
end;
Inc(i);
end;
OraStored.Free;
OraSession.Free;
when i=330 I get 'Net error : Maximum open cursors exceeded'
Is there any way to close opened cursor in while..end after getting all data?
ODAC : maximum open cursors exceeded
-
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
Same problem
Hi,
i have the same problem as you.
Did you find out what was wrong?
I thought the problem was fixed in a newer ODAC version,
but this is not the case.
There is no error if NET option is set to false.
Thank you in advance,
Vladimir
i have the same problem as you.
Did you find out what was wrong?
I thought the problem was fixed in a newer ODAC version,
but this is not the case.
There is no error if NET option is set to false.
Thank you in advance,
Vladimir
-
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53