How to implement snowflake integration with Mendix and send upsert query.
Step1.: — Download snowflake connector from Mendix Marketplace, minimum 9.24.16 Mendix version is required to use this module.
Get the snowflake connection details from snowflake support team with given details.
Account name
Authentication method
User
Private Key File Name
Private Key File
Private key password
Role
Database
Schema
Warehouse
Step2: — Add the overview page in your application menu and configure the snowflake connection. Test the same in local run before moving into higher instance.
From configuration page create new button to test the snowflake connection.
Define the constant query to test the snowflake connection.
Call the button to TEST snowflake connection from UI using below microflow.
Define the constant query to test the snowflake connection.
TEST snowflake connection from UI. You will get successfully connection message.
Create a scheduler to send mendix data into snowflake, based upon your application business requirement you can extract data and send it to snowflake.
Below is upsert query sample to insert/update data in snowflake.
=========================
MERGE INTO DEV_MENDIX.STAGING.TEST AS target USING ( SELECT '2025' AS FY, 'z00abc' AS GID, 'raju p' AS ENGINEER, 'MR.ABC D' AS SUPERVISOR )AS source ON ( DEV_MENDIX.STAGING.TEST.FY = source.FY)WHEN MATCHED THEN UPDATE SET SALESENGINEERSUPERVISOR = 'Willi D', BOOKINGGOAL = 100000, RATUSBOOKINGGOAL = 0, CPCBOOKINGGOAL = 50000, EABOOKINGGOAL = 0, RUSSELECTRICBOOKINGGOAL = 0,RSSBOOKINGGOAL = 0WHEN NOT MATCHED THEN INSERT INTO DEV_MENDIX.STAGING.TEST VALUES ('2025', 'Z004EAKT', 'raju p', 'Willi D','0211480159', 'LTT ASSOCIATES INC', 100000, 0, 50000, 0, 0, 0, 0, 0);
=======================================================
Well explained, thanks for sharing!
Thanks for sharing. It is a wonderful approach to implement snowflake integration with Mendix.
Thanks for sharing!!