In a previous question that I posted, the answer that I accepted involved creating a Virtual Layer from a source layer. The query used to create the Virtual Layer was:
select *
from my_layer
order by field_a
Although the query works as intended, some of the source field types are converted to different types in the Virtual Layer. Specifically:
- Integer (32 bit) are converted to Integer (64 bit)
- Date and Date&Time are converted to Text (string)
- Boolean are converted to Integer (64 bit)
I use the Refactor Fields to get the field types back to their original, but this involves another step that I would prefer to eliminate.
Question: How to create a Virtual Layer that retains the source field types?