
--freemarker template

<#if SQLdialect='Postgres'>
select sp_update_sequence('sx_repository');

</#if>


delete from tmp_repository where id in (select id from sx_repository);

insert into sx_repository
(
       id,
       content,
       caption,
       comment,
       version,
       art,
       art2,
       art3,
       sachgebiete_id,
       sort1,
       sort2,
       sort3,
       geaendert_am,
       aktiv,
       gueltig_seit,
       gueltig_bis
)

SELECT 
       id,
       content,
       caption,
       comment,
       version,
       art,
       art2,
       art3,
       sachgebiete_id,
       sort1,
       sort2,
       sort3,
       geaendert_am,
       aktiv,
       gueltig_seit,
       gueltig_bis
FROM tmp_repository;

<#if SQLdialect='Postgres'>
select sp_update_sequence('sx_repository');
</#if>

drop table tmp_repository;

