Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNION ALL problem #11

Open
hamild opened this issue Aug 30, 2017 · 2 comments
Open

UNION ALL problem #11

hamild opened this issue Aug 30, 2017 · 2 comments

Comments

@hamild
Copy link

hamild commented Aug 30, 2017

AlaSQL node is very good but I'm having difficulty performing a UNION ALL when I do a Select on two spreadsheets (or two sheets from one spreadsheet). Node-red crashes with an uncaught exception error ...
30 Aug 11:23:53 - [red] Uncaught Exception:
30 Aug 11:23:53 - TypeError: Cannot read property 'data' of undefined
at queryfn3 (C:\Users\IBM_ADMIN.node-red\node_modules\alasql\dist\alasql.fs.js:6401:11)
at queryfn2 (C:\Users\IBM_ADMIN.node-red\node_modules\alasql\dist\alasql.fs.js:6305:9)
at C:\Users\IBM_ADMIN.node-red\node_modules\alasql\dist\alasql.fs.js:15680:10
at C:\Users\IBM_ADMIN.node-red\node_modules\alasql\dist\alasql.fs.js:3591:21
at C:\Users\IBM_ADMIN.node-red\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)

I can read data from individual spreadsheets or tables but if I try the UNION it fails.
Here's my SQL from within the node..
select * from xlsx("c:\union.xlsx")
union all
select * from xlsx("c:\union2.xlsx")

These are small (2 lines) worksheets and are exactly the same format (NAME, SURNAME, ID)

@mathiasrw
Copy link
Member

Hi @hamild

You will have to load data into a table to make it work.

As both actions are async, I am not sure this can be done at the moment with the alasql node.

If you are interested I can coatch you on how to do this with a "regular" javascript node...

@hamild
Copy link
Author

hamild commented Aug 30, 2017

Hi Mathias. Thanks for your response. I had forgotten about loading data... I will try some variations on that first and see what happens :-)

@hamild hamild closed this as completed Aug 30, 2017
@hamild hamild reopened this Aug 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants