Page 1 of 1

error - Cannot perform this operation on an open dataset

Posted: Mon 14 Apr 2008 13:49
by db1-seiji
Hi people

I found a prob i am using Win XP SP2, Delphi 7 update 2, Oracle 10, DBExpress component, Core lab DBXOda 4.2

when a try to use a SqlQuery named as qryGenerica linked with cdsGenerica, i set cdsGenerica.commandtext := ' Select aFunction(1) from dual ' and cdsGenerica.Open

--------
CREATE OR REPLACE FUNCTION aFunction(a NUMBER) RETURN NUMBER IS
BEGIN
raise_application_error(-20500, 'aFunction');
RETURN a;
end aFunction;
--------
it returns a exception.
After this i try to use the same cdsGenerica again... like cdsGenerica.commandtext := ' Select 1 from dual ' and cdsGenerica.Open

i got this error "Cannot perform this operation on an open dataset"

if i change the SqlConnection.ConnectionName Oracle "(Core Lab)" to "OracleConnection" it works.

Any help?
Thank you.

Posted: Wed 16 Apr 2008 07:49
by Plash
We cannot reproduce the problem. When I set a value to CommandText property of TClientDataSet component, and try to open it, an exception 'CommandText changes are not allowed' is raised.

You can assign a SQL text to SQL property of TSQLQuery component.