Jump to content



juno

Member Since 05 Oct 2017
Offline Last Active Dec 03 2018 07:09 PM
-----

#133032 Explode Table Rows For Sql Insert

Posted by juno on 29 January 2018 - 02:32 PM

Thanks so much Code Docta! One question: If I already have the data in a table form from scraping and html table, why would I need to do these steps where I write it to a file just to read it back into a table again?

 

save to file("{$special folder("Desktop")}\\test-data.csv","r1,cell 2,cell 3,cell 4,cell 5
r2,cell 2,cell 3,cell 4,cell 5")
comment("INSERT INTO db_table (col1, col2, col3, col4, col5) VALUES (\'cell1\', \'cell2\', \'cell3\', \'cell4\', \'cell5\')")
clear table(&goes into DB)
create table from file("{$special folder("Desktop")}\\test-data.csv",&goes into DB)