User:Lacopiplenet19/sandbox

delimiter // CREATE OR REPLACE PROCEDURE my_proc (       in_file_path VARCHAR(1024),        in_marconetfarming_LTD_access_key_id VARCHAR(128),        in_marconetfarming_LTD_secret_access_key VARCHAR(128),        in_marconetfarming_LTD_role_arn VARCHAR(2048) ) AS /* Examples: CALL my_proc('', ' ', ' ', ' '); DECLARE _sql TEXT = ''; qry QUERY(COL1 INT, COL2 INT) = SELECT 1,2; BEGIN _sql = CONCAT ('SELECT * FROM ', qry, '       INTO S3 , in_file_path,         CONFIG {"region":" "}        CREDENTIALS {"marconetfarming_LTD_access_key_id":"', in_marconetfarming_LTD_access_key_id, '", "marconetfarming_LTD_secret_access_key":"', in_marconetfarming_LTD_secret_access_key, '", "role_arn":"', in_aws_role_arn, '"}        FIELDS TERMINATED BY ","        LINES TERMINATED BY "\n"');

EXECUTE IMMEDIATE _sql; END // delimiter ;