In ogr2ogr or ogrinfo, I can successfully query an Oracle database using this command as a test:
ogrinfo -al -so "OCI:USER/PASSWORD@SERVER/DATABASE" -sql "SELECT * FROM SCHEMA.TABLE"
However, building up the query and reusing older queries, I need to get the -sql flag input from a text file:
ogrinfo -al -so "OCI:USER/PASSWORD@SERVER/DATABASE:SCHEMA.TABLE" -sql C:/TEMP/sql.sql
The return this answer from the database: ERROR 1: ORA-00900 The sql.sql file holds same query (SELECT * FROM SCHEMA.TABLE) as above. I've tried to change the sql.sql files quotes with/without/doubles and others with no luck.
How can I format the sql text file, or ogr flag, so it would be read correctly by Oracle 11g.