Je dois sélectionner un certain nombre d'enregistrement par sql en utilisant using.
dans un script, la requête sql fonctionne très bien
Code : Tout sélectionner
select copaip, nunati, nobovi, nutrav, danais from file1 
join file2  using(copaip,nunati,cosu)                   
where copach = 'FR' and cheipg = '39258001' and cosu = '0' and     
dasort is null and xxx = '2'
group by COPAIP, NUNATI, Nobovi, Nutrav, Danais
order by COPAIP, NUNATICode : Tout sélectionner
EXEC SqL  DECLARE C1 CURSOR FOR
       SELECT COPAIP, NUNATI, Nobovi, Nutrav, Danais FROM file1
       join file2 using(copaip, nunati, cosu)
       where COPACH = :EàCopach and CHEIPG = :EàNuchep and DASORT is NULL and
       cosu = '0' and xxx = '2'
       group BY COPAIP, NUNATI, Nobovi, Nutrav, Danais
       order by COPAIP, NUNATI
       FOR FETCH ONLY;
       EXEC SqL OPEN C1;
       dow sqlCod = 0;
....
et j'obtiens un code erreur -203 (A column reference is ambiguous, because of duplicate names.)
Pouvez-vous me dire où je fais une erreur ?
Je vous remercie d'avance pour votre réponse
