Bug report #13731
DBManager's Oracle SQL Query "load result as new layer" gives and error
|Affected QGIS version:||2.12.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21758|
In QGIS 2.12 when using DBManager plugin with Oracle tables this bug occurs. I ran a simple SQL query like it returned the results succesfully. And than i clicked Load as new layer button to see results in QGIS canvas it gave error. The error says the reason is: ORA-00933: SQL command not properly ended. Also it gives the SQL query: . I only entered . DBManager changed the original query so it throws error.
#2 Updated by René-Luc ReLuc over 4 years ago
- Priority changed from Normal to High
It's a known issue.
In the TODO list of the oracle's db_manager plugin, we can find :
- SQL Window - Can't retrieve column: dlg_sql_window.py launch an invalid request for Oracle (no LIMIT operator in Oracle). Should patch dlg_sql_window.py to use a connector method to grab columns.
#8 Updated by Jukka Rahkonen over 4 years ago
Works for me from Oracle Database 12c Enterprise Edition Release 126.96.36.199.0 - 64bit Production:
SELECT attribute AS test FROM test_table;
This diagram shows also AS in quite many places http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm.
Could you show example SQL where AS is not supported?
#9 Updated by René-Luc ReLuc over 4 years ago
It seems to not worked for table name aliases.
This does not work:
SELECT * FROM (select * from ilceler) AS "_subQuery__0".
SELECT * FROM (select * from ilceler) "_subQuery__0".
In the documentation, the "AS" seems to be not used for table aliases (search for t_alias in http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm).