When calling a query through OCIStmtExecute() method an "ORA-01791: not a SELECTed expression." error gets thrown. When calling the same query via SQL developer it produces no errors. The error gets thrown when using DISTINCT + GROUP BY + ORDER BY clauses.
Calling "SELECT DISTINCT DUMMY FROM DUAL GROUP BY DUMMY ORDER BY DUMMY" will throw an error, when called with OCIStmtExecute() method (OCI versions tested 12.1.0, 11.2.0.), but it will run fine in SQL developer. Is there a fix to this problem?