I would like to generate a fixed width file from snowflake tables and unload it into internal stage.
Could you please guide me.
Thank you in advance!
I would like to generate a fixed width file from snowflake tables and unload it into internal stage.
Could you please guide me.
Thank you in advance!
One way to do this is to simple concatenate the columns and then add sufficient white space create the width required.
For example if we wanted a column with fixed width of 100, we could do:
USE ROLE SYSADMIN;
USE "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1";
SELECT RPAD(CONCAT(R_NAME, R_COMMENT), 100) FROM REGION;