Bug : MyQuery Editor => SQL Generator : Not working with temporary tables
-
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
Bug : MyQuery Editor => SQL Generator : Not working with temporary tables
Hi Ikar,
I have some problems with my temporary table.
I put in a temporary table some records (with a prize and quantity)
To really sum up, I let the user modify the Quantity and then update the "physical" table with values changed within the temporary table.
From time to time the user is getting an Update failed : 0 record found.
(strange since he is editing datas from the temporary table).
So, I decided to use my own update SQL Statement by using the SQL Generator.
I found that the SQL generator is not able to works with temporaries table. I guess that you are creating a new connection (for getting table / fields info).
So, in the SQL generator everything is grayed !
I have some problems with my temporary table.
I put in a temporary table some records (with a prize and quantity)
To really sum up, I let the user modify the Quantity and then update the "physical" table with values changed within the temporary table.
From time to time the user is getting an Update failed : 0 record found.
(strange since he is editing datas from the temporary table).
So, I decided to use my own update SQL Statement by using the SQL Generator.
I found that the SQL generator is not able to works with temporaries table. I guess that you are creating a new connection (for getting table / fields info).
So, in the SQL generator everything is grayed !
Yes, it can be a problem.
> From time to time the user is getting an Update failed : 0 record found.
Please specify list of fields (with types), used in WHERE clause.
> I guess that you are creating a new connection (for getting table /
fields info).
We will think about improving this functionality in next MyDAC version. As temporary solution you can write SQLUpdate manually.
> From time to time the user is getting an Update failed : 0 record found.
Please specify list of fields (with types), used in WHERE clause.
> I guess that you are creating a new connection (for getting table /
fields info).
We will think about improving this functionality in next MyDAC version. As temporary solution you can write SQLUpdate manually.
-
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
Thank you for the feed back.
As you said, I write the SQLUpdate manualy (and it seems to works).
FYI here is my both SQL Statement
The Select query to display my Records from the temp table
As said, with some records i'm getting the Update Error : 0 Records found.
It is funny because i'm fetching distinct records
As you said, I write the SQLUpdate manualy (and it seems to works).
FYI here is my both SQL Statement
Code: Select all
-- Creation Temp table
DROP TEMPORARY TABLE IF EXISTS ReperesTmp;
CREATE TEMPORARY TABLE IF NOT EXISTS ReperesTmp
Select
IdRepereAffaireFCI, -- integer autoinc
IdAffaireFCI, -- integer
(QuantiteProduit - QuantiteProduction) as QuantiteRepere, -- float
(QuantiteProduit - QuantiteProduction) as QuantiteAAssigner, -- float
(PVFUnitairePoseHT + PVFUnitairePRoduitHT + ProrataUnitairePoseHT +ProrataUnitaireProduitHT) as PVFOriginalUnitaireHT, --float
(PVFUnitairePoseHT + PVFUnitairePRoduitHT + ProrataUnitairePoseHT +ProrataUnitaireProduitHT) as PVFUnitaireHT, -- float
(PVFUnitairePoseHT + PVFUnitairePRoduitHT + ProrataUnitairePoseHT +ProrataUnitaireProduitHT) as PVFForfaitaireUnitaireHT, -- float
idAffaireFCI as id, -- integer
IdRepereClient, -- Varchar
IdDevis, -- integer
Avenant, -- tinyint
IdGroupeProduit, -- char
largeur, -- float
hauteur, -- float
Designation, -- varchar
TauxTVA, -- float
IdAvenant, -- tinyint
'' as IdVarianteTechnique, -- char
QuantitePose -- float
from
Reperesaffairesfci
where
IdRepereAffaireFCI in ( 1,2,3 ) -- integer
And ((QuantiteProduit - QuantiteProduction)>0) -- float;
Code: Select all
SELECT
IdRepereAffaireFCI,
IdAffaireFCI,
QuantiteRepere,
QuantiteAAssigner,
id,
QuantitePose,
PVFOriginalUnitaireHT,
PVFUnitaireHT,
PVFForfaitaireUnitaireHT,
IdRepereClient,
IdDevis,
Avenant,
IdGroupeProduit,
Largeur,
Hauteur,
Designation,
TauxTVA,
IdAvenant,
IdVarianteTechnique
FROM
reperestmp
It is funny because i'm fetching distinct records
-
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59