I have workflow set up in Easymorph and will export the data to SQL server.
The purpose is that:
if the data records are already in SQL table, then we need to update the records
If the data records don’t exist in SQL table, we insert the data
I notice that the Export to Database and Update Database table is separate action, is there any way that we can combine the above conditions in one action? or any other suggestion?
updating and inserting can’t be combined into one operation in EasyMorph. Instead, derive two tables from your main table. In one table, use filters to keep the records that already exist and for them do “Update DB table”. In the other table, keep only the records that don’t exist, and for them do “Export to database”.
Nikolaas, upsert will not be implemented in the next release because it can’t be implemented with a common workflow for all the supported SQL dialects. But it’s possible that we will implement upsert in one of the following releases.
I can’t tell for your actual case without additional details, but in the general case you will be able to implement upsert with the following workflow:
Use the “Select matching DB rows action” to import all the rows which are present in both EasyMorph dataset and…
Hi Luis and welcome to the Community!
While there is no “UPSERT” action in EasyMorph, the canonical way of doing upserts is to derive two tables, and then use the “Keep/remove matching” action to keep records that already exist (and need to be updated) in one derived table, and new records (that need to be inserted) in the other derived table. Then use the “Update” action in one derived table, and “Export to database” in the other.
Also, to check whether a record ID exists in Snowflake, you ca…
Thank you! ya the way you suggested is the way I’m trying right now.
But good to get your confirmation. thanks