
Problems during checks on import
Problems during checks on import
I need to check the completion of some imports inside a DQL as follow:
--
-- Imports Gruppi e Ruoli
--
delete records in MimkAnagGruppi .
if count of MimkAnagGruppi > 0 then message "Tabella in uso. Operazione Interrotta !" window . exit . end .
delete records in TaakAnagGruppi .
if count of TaakAnagGruppi > 0 then message "Tabella in uso. Operazione Interrotta !" window . exit . end .
------------------------------------------------------------------------------------------------------------
import "Gruppi" .
--------------------------------------------
delete records in MimjAnagRuoli .
if count of MimjAnagRuoli > 0 then message "Tabella in uso. Operazione Interrotta !" window . exit . end .
delete records in TaajAnagRuoli .
if count of TaajAnagRuoli > 0 then message "Tabella in uso. Operazione Interrotta !" window . exit . end .
------------------------------------------------------------------------------------------------------------
import "Ruoli" .
------------------------------------------
if count of MimkAnagGruppi = 0 then message "Table Gruppi (MimkAnagGruppi) not loaded in DE!" window . exit. end .
if count of MimjAnagRuoli = 0 then message "Table Ruoli(MimjAnagRuoli) not loaded in DE!" window . exit. end .
--
The procedure return to me always "Tabella Gruppi (MimkAnagGruppi) not loaded in DE!" even if it has been loaded correctly.
If I run the marked istructions in a separate DQL all is done correctly. Why ?
Re:Problems during checks on import
All DQLs in DataEase keep a "logical" lock on the scope of that DQL.
You should never do a delete records in the same procedure as you are doing processing. It might work, but most of the time it doesn't.
Run a DQL to do all the deleting and then another that do the processing.
This is a fundamental "process" in DataEase and even though ideally it would be nice if it was different, this is one of the things that is best avoided.