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
Maximum open cursors exceeded
Moderators: gto, cipto_kh, EgonHugeist
I am using only components:
a) TZConnection
I am changeing values (in Onject Insepector):
- Database
- Password
- Protocol (oracle)
- User
b) TZQuery
I am changeing values to (in Onject Insepector):
- Connection
The propert
- SQL
I am changeing in my programm
I Suppose I don't' init properly?
Regards
a) TZConnection
I am changeing values (in Onject Insepector):
- Database
- Password
- Protocol (oracle)
- User
b) TZQuery
I am changeing values to (in Onject Insepector):
- Connection
The propert
- SQL
I am changeing in my programm
I Suppose I don't' init properly?
Regards
I find it
I find an answer. There is one thing to do.
The change is in the Zeos Source Code:
In the sorce code change:
destructor TZAbstractStatement.Destroy;
to new text:
{**
Destroys this object and cleanups the memory.
}
destructor TZAbstractStatement.Destroy;
begin
// Fabian: Begin fix of bug #1076975
Close;
// Fabian: End of fix
if Assigned(FBatchQueries) then
FBatchQueries.Free;
FBatchQueries := nil;
FConnection := nil;
FInfo.Free;
FLastResultSet := nil;
inherited Destroy;
end;
from:
http://sourceforge.net/tracker/index.ph ... tid=415826
Thank you for your help
Regards
The change is in the Zeos Source Code:
In the sorce code change:
destructor TZAbstractStatement.Destroy;
to new text:
{**
Destroys this object and cleanups the memory.
}
destructor TZAbstractStatement.Destroy;
begin
// Fabian: Begin fix of bug #1076975
Close;
// Fabian: End of fix
if Assigned(FBatchQueries) then
FBatchQueries.Free;
FBatchQueries := nil;
FConnection := nil;
FInfo.Free;
FLastResultSet := nil;
inherited Destroy;
end;
from:
http://sourceforge.net/tracker/index.ph ... tid=415826
Thank you for your help
Regards
Ahh, this already is applied in testing branch. Will be officical with next release also.
http://users.telenet.be/mdaems
http://users.telenet.be/mdaems
fabian