Page 1 of 1

MyDAC 5.70.0.42 Master / Detail Bug

Posted: Wed 10 Dec 2008 16:25
by swierzbicki
Hi,

I have found a bug when working with Master / Details :

On the Detail Query fill :

SQL with this script :

Code: Select all

SET @MyVAR = (SELECT Field FROM Table WHERE Field = :Field)  ;
DROP TEMPORARY TABLE IF EXISTS TmpTable;
CREATE TEMPORARY TABLE IF NOT EXISTS TmpTable
SELECT 
@MyVAR as MyVar,
convert(:Field, CHAR(10)) as Field;
SELECT *  FROM TmpTable
Set the master and details keys to 'Field'
Set the keyfields to 'Field'
Set Debug to true


Double click on the query and in the SQL Editor select 'Data Editor...'
The debug output will show this :

Code: Select all

SET @MyVAR = (SELECT Field FROM Table WHERE (Field = :Field)  ;
DROP TEMPORARY TABLE IF EXISTS TmpTable;
CREATE TEMPORARY TABLE IF NOT EXISTS TmpTable
SELECT 
@MyVAR as MyVar,
convert(:Field, CHAR(10)) as Field;
SELECT *  FROM TmpTable) AND Field= :Field

:Field(String[5])='Value' 
:Field(String[5])='Value' 
:Field(String[5])='Value' 
You can see that the

Code: Select all

SELECT *  FROM TmpTable) AND Field= :Field
is wrong : a ')' is added instead the 'Where' keyword.

If I remove the 'where' located in the 'SET' statement, the query will be correctly changed and executed by MyDAC.

This is a simple exemple, in my case, I have about 20 parameters in my 'SET' statement...

Re: MyDAC 5.70.0.42 Master / Detail Bug

Posted: Wed 10 Dec 2008 20:14
by eduardosic
as temporary solution, try to clean property DetailFields.

Posted: Thu 11 Dec 2008 10:19
by swierzbicki
Hi Eduardosic,

Thank you for the tips but that's what I've already done : I've removed the master/Detail link and I've manually set my parameter. This is a temporary solution : I have other nested queries where I need that the master / detail mechanism to work !

I'm sure that Devart team will found a solution ;)

Posted: Thu 11 Dec 2008 13:44
by Dimon
We will investigate possibility to add such functionality, but it is hardly to happen in the nearest future.
Please create master-detail relationship by adding parameters manually.

Posted: Thu 11 Dec 2008 13:53
by eduardosic
Dimon wrote:We will investigate possibility to add such functionality, but it is hardly to happen in the nearest future.
Please create master-detail relationship by adding parameters manually.
swierzbicki can create a master-detail with form link and clean property DetailFields, more speed.

Posted: Fri 12 Dec 2008 09:06
by swierzbicki
Hi Dimon,

Please note that this used to worked in version prior to 5.x !
It will be nice to have this working again ;)

Posted: Tue 16 Dec 2008 12:41
by Dimon
Please specify the MyDAC version it works with.

Posted: Fri 19 Dec 2008 10:11
by swierzbicki
I don't have all myDAC version on my laptop.
The only thing I know is that my software was out on November 2007 !

Posted: Fri 19 Dec 2008 13:39
by Dimon
I can not find any MyDAC build in which this situation is processed correctly, but we will investigate the possibility of solving this problem.

Posted: Fri 19 Dec 2008 21:44
by swierzbicki
Ok !
Thank you for trying to solve this !