- 
                Notifications
    You must be signed in to change notification settings 
- Fork 689
How to insert data into the table
        Mathias Rangel Wulff edited this page Mar 19, 2018 
        ·
        2 revisions
      
    AlaSQL provides three different methods to insert data from array into table:
    var data = [{a:1}, {a:2}];
    alasql('CREATE TABLE one');
    
    // Method 1
    alasql.tables.one.data = data;
    // Method 2
    alasql('SELECT * INTO one FROM ?',[data]);
    // Method 3
    alasql('INSERT INTO one SELECT * FROM ?',[data]);If you download data from external file, you can use this syntax:
    alaslq('CREATE table one; SELECT * INTO one FROM JSON("data.json")');© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo