Business Requirements:-
Special Request Reservation Charges Data Importer from Kigo PMS System.
SELECT * FROM src_hist_kigo_reservation_report;
# TOTAL HISTORICAL RECORDS => 150371
# RUN-1 => 1 - 20000
# RUN-2 => 20001 - 40000
# RUN-3 => 40001 - 60000
# RUN-4 => 60001 - 80000
# RUN-5 => 80001 - 100000
# RUN-6 => 100001 - 120000
# RUN-7 => 120001 - 150376
SELECT * FROM src_hist_kigo_reservation_report f;
# RUN-1 => 1 - 20000
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 1 AND 20000;
# RUN-2 => 20001 - 40000
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 20001 AND 40000;
# RUN-3 => 40001 - 60000
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 40001 AND 60000;
# RUN-4 => 60001 - 80000
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 60001 AND 80000;
# RUN-5 => 80001 - 100000
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 80001 AND 100000;
# RUN-6 => 100001 - 120000
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 100001 AND 120000;
# RUN-7 => 120001 - 140000
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 120001 AND 140000;
# RUN-8 => 140001 - 150376
SELECT * FROM src_hist_kigo_reservation_report f
WHERE f.id BETWEEN 140001 AND 150376;
################### SQL DUMPS #####################
SELECT DISTINCT r.id, r.reservation_id
FROM src_kigo_import_data_run1_1 r
LEFT JOIN tia_kigo_reservation_charges_import_processing_run1_1 f ON r.reservation_id = f.reservation_id
WHERE f.reservation_id IS NULL;
SELECT * FROM src_kigo_import_data_run1_2;
SELECT DISTINCT reservation_id
FROM tia_kigo_reservation_charges_import_processing_run1_2;
SELECT DISTINCT r.id, r.reservation_id
FROM src_kigo_import_data_run1_2 r
LEFT JOIN tia_kigo_reservation_charges_import_processing_run1_2 f ON r.reservation_id = f.reservation_id
WHERE f.reservation_id IS NULL;
SELECT DISTINCT r.id, r.reservation_id
FROM src_kigo_import_data_run1_3 r
LEFT JOIN tia_kigo_reservation_charges_import_processing_run1_3 f ON r.reservation_id = f.reservation_id
WHERE f.reservation_id IS NULL;
SELECT DISTINCT r.id, r.reservation_id
FROM src_kigo_import_data_run1_4 r
LEFT JOIN tia_kigo_reservation_charges_import_processing_run1_4 f ON r.reservation_id = f.reservation_id
WHERE f.reservation_id IS NULL;
SELECT DISTINCT r.id, r.reservation_id
FROM src_kigo_import_data_run1_1 r
LEFT JOIN tia_kigo_reservation_charges_import_processing_run1_1 f ON r.reservation_id = f.reservation_id
WHERE f.reservation_id IS NULL;
CREATE TABLE src_kigo_import_data_run1 AS
SELECT * FROM src_kigo_import_data_run1_1
union
SELECT * FROM src_kigo_import_data_run1_2
union
SELECT * FROM src_kigo_import_data_run1_3
union
SELECT * FROM src_kigo_import_data_run1_4
union
SELECT * FROM src_kigo_import_data_run1_5;
CREATE TABLE tia_kigo_reservation_charges_import_processing_run1 AS
SELECT * FROM tia_kigo_reservation_charges_import_processing_run1_1
union
SELECT * FROM tia_kigo_reservation_charges_import_processing_run1_2
union
SELECT * FROM tia_kigo_reservation_charges_import_processing_run1_3
union
SELECT * FROM tia_kigo_reservation_charges_import_processing_run1_4
union
SELECT * FROM tia_kigo_reservation_charges_import_processing_run1_5;
SELECT
DISTINCT f.reservation_id
FROM src_kigo_import_data_run1 f
JOIN tia_kigo_reservation_charges_import_processing_run1 r ON r.reservation_id = f.reservation_id
SELECT * FROM tia_kigo_reservation_charges_import_processing;
- api_response: 1 => Transaction Found
- api_response: -1 => Transaction is NULL
Configuration Parameters:-
- domain = "realjoy"
- local_db_name = "realjoy"
- environment = "mash_sandbox"
- sheet_name = ""
- gsheet_url = ""