--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/9898a94c-3e50-ce0e-dace-12901b3ff6b0%40ibphoenix.com.
Simply create global temporary table with e.g. ON COMMIT DELETE ROWS and fill it with new xml data.
And do below 2 statements in same transaction as above inserts into global temporary table:
merge into einvoiceusers e
using (select * from TMP_NEW_XML) e2
on (e.vkntckn = e2.vkntckn)
when matched
AND (
e.PK IS DISTINCT FROM e2.PK
or e.NAME IS DISTINCT FROM e2.NAME
or e.TYPE IS DISTINCT FROM e2.TYPE
or e.date IS DISTINCT FROM e2.date
or e.MAILBOX IS DISTINCT FORM e2. MAILBOX) then update set pk=e2.pk, name=e2.name, type=e2.type, e.date=e2.date,mailbox=e2.mailbox, created_at=e2.create_at,modified_at=current_timestamp
when not matched then insert(vkntckn,pk,type,"date",mailbox,created_at) values(e2. Vkntckn, e2.pk, e2.pk, e2.Type, e2. Date, e2.Mailbox, e2.created_at);
DELETE FROM einvoiceusers e WHERE NOT EXISTS(SELECT * FROM TMP_NEW_XML T where T. vkntckn=e. vkntckn)
Regards,
Karol Bieniaszewski
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/CAH2i4yd_ypG0u%2Bdt45e5YgR1Z0c%2BOOv79vaBNDPWtxob1Xw17w%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/119245bc-04b9-6d5b-98cd-fc4c7486e3bf%40ibphoenix.com.