Query failed for Oracle

XMLWordPrintable

    • Type: Incident report
    • Resolution: Fixed
    • Priority: Major
    • 1.8.4
    • Affects Version/s: 1.8.4
    • Component/s: Frontend (F)
    • None
    • Environment:
      Oracle 10g2

      ociexecute() [<a href='function.ociexecute'>function.ociexecute</a>]: ORA-00904: "CNT": invalid identifier[/var/www/zabbix/include/db.inc.php:444]
      SQL error [ORA-00904: "CNT": invalid identifier] in [SELECT key_, count(*) as cnt FROM items WHERE (hostid IN (30103)) GROUP BY key_ HAVING cnt > 1]
      ocifetchinto() [<a href='function.ocifetchinto'>function.ocifetchinto</a>]: ORA-24374: define not done before fetch or execute and fetch[/var/www/zabbix/include/db.inc.php:597]
      ociexecute() [<a href='function.ociexecute'>function.ociexecute</a>]: ORA-00904: "CNT": invalid identifier[/var/www/zabbix/include/db.inc.php:444]
      SQL error [ORA-00904: "CNT": invalid identifier] in [SELECT name, count(*) as cnt FROM applications WHERE (hostid IN (30103)) GROUP BY name HAVING cnt > 1]
      ocifetchinto() [<a href='function.ocifetchinto'>function.ocifetchinto</a>]: ORA-24374: define not done before fetch or execute and fetch[/var/www/zabbix/include/db.inc.php:597]

      Oracle not understand aliases in GROUP BY, ORDER BY, HAVING.
      Need:
      SELECT key_, count as cnt FROM items WHERE (hostid IN (30103)) GROUP BY key_ HAVING count > 1;

            Assignee:
            Unassigned
            Reporter:
            Alexey Pustovalov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: