Hi
I have a really nasty problem. My application build with Delphi 7 and ODAC 7.00.0.3 crashes when main query becomes empty after opening it. Message some kind of read address from ????.
I can't reproduce it in simple application, but I think that the problem is when:
SmartQuery1 (MainQuery)
DataSource1 (DataSet=MainQuery)
SmartQuery2 (SubQuery, SubQuery.MasterSource=DataSource1)
when MainQuery has data then SubQuery execute 1 SQL statement (saw via OraMonitor)
when MainQuery is empty then SubQuery execute 2 same SQL statements with null params (saw via OraMonitor).
so if there are more than 2 Queries, and they are more complicated, and have own SubQueries (and some events on after scroll), and cxGrid (more afterscroll events) it can be harmful...
The question is why on empty MainQuery SubQuery via MasterSource opened twice and can it be fixed?
SmartQuery with MasterSource and empty detail dataset crash
Hello,
I could not reproduce the problem.
I have tested this problem in the following way:
and in DBMonitor I can see only one query even if MainQuery is empty.
So please send a complete sample to alexp*devart*com to demonstrate the problem including a script to create and fill tables.
I could not reproduce the problem.
I have tested this problem in the following way:
Code: Select all
CREATE TABLE DEPT (
DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
DNAME VARCHAR2(14) ,
LOC VARCHAR2(13)
);
CREATE TABLE EMP (
EMPNO NUMBER(4) CONSTRAINT PK_EMP PRIMARY KEY,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2) CONSTRAINT FK_DEPTNO REFERENCES DEPT
);Code: Select all
MainQuery:= TSmartQuery.Create(nil);
MainQuery.Session := OraSession1;
MainQuery.SQL.Text := 'select * from dept where deptno = :deptno';
MainQuery.ParamByName('deptno').DataType := ftInteger;
MainQuery.ParamByName('deptno').ParamType := ptInput;
SubQuery:= TSmartQuery.Create(nil);
SubQuery.Session := OraSession1;
SubQuery.SQL.Text := 'select * from emp';
MainDataSource:= TOraDataSource.Create(nil);
MainDataSource.DataSet := MainQuery;
SubQuery.MasterSource := MainDataSource;
SubQuery.MasterFields := 'DEPTNO';
SubQuery.DetailFields := 'DEPTNO';
MainQuery.ParamByName('deptno').AsInteger := -1; //value doesn't exists
MainQuery.Open;
SubQuery.Open;So please send a complete sample to alexp*devart*com to demonstrate the problem including a script to create and fill tables.