AlaSQL / node-red-contrib-alasql

A Node-RED node wrapping AlaSQL for fast SQL based in-memory data processing for BI and ERP applications.
MIT License
8 stars 11 forks source link

Trying to query direct on a CSV file doesn't work if using payload as the filename #39

Open TotallyInformation opened 4 years ago

TotallyInformation commented 4 years ago

I have a query that works perfectly if I put it in the query window. But if I try to move the filename to msg.payload (using the inject node) and use either FROM ? or FROM $0, it doesn't work. There is no error but zero records are returned.

This works:

SELECT * 
FROM 'C:/Users/xxxxx/Staff List for COVID19 21Sep20.csv'
WHERE Employee_Last_Name = "Knight"

This does not (where msg.payload = 'C:/Users/xxxxx/Staff List for COVID19 21Sep20.csv') :

SELECT * 
FROM ?
WHERE Employee_Last_Name = "Knight"

Neither does this:

SELECT * 
FROM $0
WHERE Employee_Last_Name = "Knight"

This, however, does work (where msg.payload = 'Knight'):

SELECT * 
FROM 'C:/Users/xxxxx/Staff List for COVID19 21Sep20.csv'
WHERE Employee_Last_Name = $0
mathiasrw commented 4 years ago

Hmm. Interesting usecase. I cant look into it the next weeks - but will flag it as something to be addressed.