Archi Forum

Archi => General Archi Discussion => Topic started by: ChampagnePerry on July 01, 2022, 14:48:59 PM

Title: HTML report and Alasql SELECT INTO CSV()
Post by: ChampagnePerry on July 01, 2022, 14:48:59 PM
Hi all,
I was just wondering if anyone had managed to use the AlaSQL SELECT <field list> FROM <table> INTO CSV("filename") and get it to work.
AlaSQL says it supports this but I can't get it to work at all.

When I run
SELECT e.name, e.documentation FROM Elements e JOIN ViewsContent vc ON e.id=vc.contentid JOIN Views v ON v.id=vc.viewid WHERE e.specialization="Data Domain" AND v.name="Data Governance Domains"

I get a nice list in the browser

When I run
SELECT e.name, e.documentation FROM Elements e JOIN ViewsContent vc ON e.id=vc.contentid JOIN Views v ON v.id=vc.viewid INTO CSV("DataDomains.csv") WHERE e.specialization="Data Domain" AND v.name="Data Governance Domains"
I get nothing, no error, no output - but that may be because it is trying to redirect the output to the file, no file (unless it is writing it somewhere but I just can't find it)

Any Ideas?
Anything I'm missing (quite likely)
Anything Stupid I'm doing (highly likely)

Thanks in advance.
Title: Re: HTML report and Alasql SELECT INTO CSV()
Post by: Jean-Baptiste Sarrodie on July 01, 2022, 16:29:20 PM
Hi,

The INTO clause should come before the FROM clause:
SELECT <field list> INTO CSV('<filename>') FROM <table>
Regards,

JB
Title: Re: HTML report and Alasql SELECT INTO CSV()
Post by: ChampagnePerry on July 04, 2022, 12:46:17 PM
Thanks JB  :-[