I am an awk newbie. I have only doen one liners.
I am confused with the while loop and printf
output for program below.
I wish to automate a data refresh in a Development environment INSERT statements. My propose awk routine will
read text file of table, column and column sequence.
The imput data is:
Table Column Column Sequence
ACCOUNT_MASTER CHANNEL_ID 1
ACCOUNT_MASTER ACCOUNT_ID 2
ACCOUNT_MASTER LAST_UPDATE 3
PRODUCT PRODUCT_CODE 1
PRODUCT PRODUCT_COST 2
REGION REGION_ID 1
REGION ZIP 2
The desired output for each table is:
INSERT INTO TABLE_NAME
(COL1,
COL2,
COL3)
SELECT
COL1,
COL2,
COL3
FROM TABLE_NAME@PROUCTION;
COMMIT;
I am confused with the while loop and printf
output for program below.
I wish to automate a data refresh in a Development environment INSERT statements. My propose awk routine will
read text file of table, column and column sequence.
The imput data is:
Table Column Column Sequence
ACCOUNT_MASTER CHANNEL_ID 1
ACCOUNT_MASTER ACCOUNT_ID 2
ACCOUNT_MASTER LAST_UPDATE 3
PRODUCT PRODUCT_CODE 1
PRODUCT PRODUCT_COST 2
REGION REGION_ID 1
REGION ZIP 2
The desired output for each table is:
INSERT INTO TABLE_NAME
(COL1,
COL2,
COL3)
SELECT
COL1,
COL2,
COL3
FROM TABLE_NAME@PROUCTION;
COMMIT;