java - duplicated column while copying data -
hi guys copying data oracle postgresql database.there n issue raised while copying because of duplicated primary keys , want continue copying data , , log duplicated key .here did
, issue got in french
<?xml version="1.0" encoding="utf-8"?><!doctype etl system "http://scriptella.javaforge.com/dtd/etl.dtd"> <etl> <description> test script pour table article </description> <connection id="in" driver="oracle" url="jdbc:oracle:thin:@localhost:1521:xe" user="iptech" password="iptech" /> <connection id="out" driver="postgresql" url="jdbc:postgresql://localhost:5432/gemodb" user="postgres" password="maher" /> <connection id="janino" driver="janino" /> <connection id="log" driver="text" /> <query connection-id="in"> select codearticle,structure, des,typemark,typ,imploc,marque,gamme,tar iptech.tmp_article ; <query connection-id="janino"> import java.io.*; import java.lang.*; import org.apache.commons.lang3.stringutils; import org.apache.commons.lang3.*; boolean result= false ; object obj =get("codearticle"); if (stringutils.isnumeric(obj.tostring())) { <!-- system.out.println("ok "); --> result=true ;} else{ result=false ;} set("result", result); next(); <script connection-id="out" if="result"> insert public.articles (id, is_enabled,type_marketing,type_tarif,description,gamme,import_local,marque,reference,struct,family_id) values (cast(?codearticle bigint) ,'true',?typemark,?tar,?des,?gamme,?imploc,?marque,?codearticle,?structure,cast(?{structure.substring(0, 2)} bigint)); </script> </query> </query> </etl>
and issue got
location: /etl/query[1]/query[1]/script[1] jdbc provider exception: unable execute statement error statement: insert public.articles (id, is_enabled,type_marketing,type_tarif,description,gamme,import_local,marque,reference,struct,family_id) values (cast(? bigint) ,'true',?,?,?,?,?,?,?,?,cast(? bigint)). parameters: [662180137, 2, , xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, , local, , 662180137, 1173201099902, 11] error codes: [23505, 0] driver exception: org.postgresql.util.psqlexception: erreur: la valeur d'une clé dupliquée rompt la contrainte unique « articles_pkey » detail: la clé « (id)=(662180137) » existe déjà.
any appreciated , lot
Comments
Post a Comment