4

I keep getting "Referenced table C:\Users\IA\Documents\QGIScsvtest1.csv in query not found!" fault message when trying to read a CSV.

I go to create a virtual layer (I want to keep the CSV out of QGIS to be able to work on it without having to reload it all the time). I want for example new data to show in QGIS without having to close and reopen QGIS.

I enter this query:

SELECT * FROM 'C:\Users\IA\Documents\QGIScsvtest1.csv

and get the aforementioned fault. QGIS finds the file while I am doing the query. I have tried different file names and search paths.

The data is very basic:

enter image description here

It is in Sweref 99TM EPSG:3006

I have checked with a couple AI's, but it is going in circles at this point.

I have tried reading the csv directly into QGIS and it works, and from there I can (but don't want to) virtualize it.

That worked, once I got the make_point sorted.

1 Answer 1

14

You can't refer directly to the file name. Instead, you can define an embeded layer - which doesn't have to be loaded in QGIS, and you can then use it as the table name in the query

enter image description here

Then you would have to build the geometry, something like select *, make_point(x,y) as geometry from my_csv_file

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.