Maximum open cursors exceeded
Posted: 12.07.2006, 15:52
Ja hava an application in Delphi 7 and Zeos. I connect to Oracle 10g Express Edition. When I am trying insert record to a really small table I have an error:
"SQL Error: ORA-01000: maximum open cursor exceeded"
In the file INIT.ORA I found a line
open_cursors=300
and change it to:
open_cursors=1024
then restart the computer, but the problem appeard again
My source code is simple:
while not Eof(fh) do
begin
Readln(fh, text);
ZConnection.StartTransaction();
if not Write_2_table_ok(params) then
begin
err := true;
end;
if not err then
begin
ZConnection.Commit();
end
else begin
ZConnection.Rollback();
end;
end;
function Write_2_table_ok(params) source code:
...
try
with qInsert do
begin
Close();
SQL.Clear();
SQL.Add('insert into ');
SQL.Add(nazwa_tabeli + '(wiersz, godzina, cel_ip, cel_port) ');
SQL.Add('values :wiersz, :godzina, :cel_ip, :cel_port) ');
ParamByName('wiersz').AsString := wiersz;
ParamByName('godzina').AsString := godzina;
ParamByName('cel_ip').AsString := cel_ip;
ParamByName('cel_port').AsString := cel_port;
try
qInsert.ExecSQL();
except
isOK := false;
end;
end;
finally
qInsert.Close();
qInsert.SQL.Clear();
end;
...
Could you help me, please.
Regards
"SQL Error: ORA-01000: maximum open cursor exceeded"
In the file INIT.ORA I found a line
open_cursors=300
and change it to:
open_cursors=1024
then restart the computer, but the problem appeard again
My source code is simple:
while not Eof(fh) do
begin
Readln(fh, text);
ZConnection.StartTransaction();
if not Write_2_table_ok(params) then
begin
err := true;
end;
if not err then
begin
ZConnection.Commit();
end
else begin
ZConnection.Rollback();
end;
end;
function Write_2_table_ok(params) source code:
...
try
with qInsert do
begin
Close();
SQL.Clear();
SQL.Add('insert into ');
SQL.Add(nazwa_tabeli + '(wiersz, godzina, cel_ip, cel_port) ');
SQL.Add('values :wiersz, :godzina, :cel_ip, :cel_port) ');
ParamByName('wiersz').AsString := wiersz;
ParamByName('godzina').AsString := godzina;
ParamByName('cel_ip').AsString := cel_ip;
ParamByName('cel_port').AsString := cel_port;
try
qInsert.ExecSQL();
except
isOK := false;
end;
end;
finally
qInsert.Close();
qInsert.SQL.Clear();
end;
...
Could you help me, please.
Regards