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 TmpTableSet 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' Code: Select all
SELECT * FROM TmpTable) AND Field= :FieldIf 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...