Forum Stats

  • 3,769,913 Users
  • 2,253,030 Discussions
  • 7,875,236 Comments

Discussions

OCIStmtExecute() throws error "ORA-01791: not a SELECTed expression."

2980326
2980326 Member Posts: 3
edited Jun 29, 2015 4:47AM in Oracle Call Interface (OCI)

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?

Tagged:
This discussion has been closed.