Array Foreign Key - Bulk Update
Select and export the array foreign key metadata to a .csv file, edit in a spreadsheet like Google Sheets or Excel, then perform a bulk update in DataPancake.
Ensure you have completed Initialization Guide
1. Open a new Snowflake worksheet

2. Run a select statement for DATAPANCAKE.CORE.VW_DATASOURCE_FOREIGN_KEYS
SELECT
-- REQUIRED COLUMNS FOR BULK UPDATE
FOREIGN_KEY_ID, -- Unique ID for upsert operations - use {new_id} for new records
ARRAY_ID,
-- VIEW ONLY COLUMNS
DATASOURCE_ID,
DATASOURCE_NAME,
ARRAY_NAME,
-- EDITABLE COLUMNS FOR BULK UPDATE
PARENT_ATTRIBUTE_NAME,
FOREIGN_KEY_ALIAS_NAME,
INCLUDE_COLUMN_IN_ROW_ACCESS_POLICY,
ROW_ACCESS_POLICY_COLUMN_ORDER
FROM datapancake_documentation.core.vw_datasource_foreign_keys
ORDER BY DATASOURCE_NAME, ARRAY_NAME, PARENT_ATTRIBUTE_NAME;
3. Verify the query successfully returns a list of attribute metadata
4. Download the results as a .csv file

5. Open the .csv file in either Excel or Google Sheets

6. Edit any editable columns as needed

7. Save (Excel) or download (Google Sheets) the file

8. Load the .csv into your stage




9. Run the bulk update stored procedure
When the stored procedure completes, the attribute metadata file will be moved to the archive folder.
call <database>.<schema>.sp_update_datapancake_array_foreign_key_metadata_core(
'@<stage_name>/<staged_filename>.csv',
'@<stage_name>/<archive_folder>/',
'<snowflake_username>'
);10. Verify the integration completed successfully by running the following query
select * from datapancake.core.vw_integration_process
where user_name = 'BWOLFF'
order by integration_process_date desc;Last updated
Was this helpful?