Welcome to the Linux Foundation Forum!

Using the "AS" clause in an alasql SQL query (AngularJS)

Options

As the title suggests, I'm receiving an error warning whenever I try to utilise the AS clause in the sql query of the angular module alasql.

Error: Parse error on line 1: ... shortcode AS Short code, fname AS fullname -----------------------^ Expecting 'EOF', 'WITH', 'COMMA', 'RPAR', 'PIVOT', 'UNPIVOT', 'REMOVE', 'ORDER', 'WHERE', 'UNION', 'INTERSECT', 'EXCEPT', 'FROM', 'INTO', 'GROUP', 'LIMIT', 'OFFSET', 'END', 'ELSE', 'SEMICOLON', 'GO', got 'LITERAL'

I'm not sure what went wrong. They utilized the AS clause without issue throughout the article.

My angular code is extremely basic, as seen below:

vm.btnExport = function () {
   alasql('SELECT shortcode AS Short code, fname AS fullname INTO XLSX("test.xlsx",{headers:true}) FROM ?', [vm.list]);
};

Categories

Upcoming Training