Code: Select all
INSERT INTO ROL_DEBITEUR (ID_PERSONNE, DEBITEUR_NOM, DEBITEUR_COMPLEMENT, NOM, PRENOM)
(SELECT DISTINCT ID_PERSONNE, DEBITEUR_NOM, DEBITEUR_COMPLEMENT, NOM, PRENOM
FROM ROL_TEMP
WHERE A_TRANSMETTRE = 1
AND ID_PERSONNE NOT IN (SELECT ID_PERSONNE FROM ROL_DEBITEUR));
Note that :
1/ when I execute this query directly in SQL Developer, all works fine,
2/ if I encapsulate the query in a stored procedure, it also works fine in SQL Developer, fot faulty in a TUniStoredProc component,
3/ The SELECT DISTINCT statement executed alone (without INSERT) returns correct results even in TUniQuery.
Has anyone got any explanation for that strange behaviour ?
Thank you very much by advance.
Roland