Skip to content

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

@TotallyInformation

Description

@TotallyInformation

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions