Looks good, If you have thoughts on this. You may work on Loop or For each to get dynamic field Names.
RowNo() as Row,id From_Field (Tmp, data_csv);
Every time, We can't write this. In fact, JSON is the huge DB it could be Bull / Vast fields. So then, We can't write for them. Work on that and let us know. May be this is simple for < 50 Fields(Just Thinking)