cuba-platform / reports

CUBA Reports Addon
https://www.cuba-platform.com/
Apache License 2.0
9 stars 4 forks source link

Error sorting reports by report group with Oracle database #296

Closed gorbunkov closed 2 years ago

gorbunkov commented 2 years ago

Platform version: 7.2.15 Database: Oracle

  1. Open Report-Browse screen
  2. Sort by the group column
  3. Apply filter (=reload reports from db)

Actual result: Exception: ORA-00932: inconsistent datatypes: expected - got CLOB

This happens because sorting by REPORT_GROUP.LOCALE_NAMES is performed, but the column type is CLOB. This causes the error.

The solution may be to change the LOCALE_NAMES column type to VARCHAR2, something like this:

alter table REPORT_GROUP add LOCALE_NAMES_2 varchar2(4000 char);
update REPORT_GROUP set LOCALE_NAMES_2 = TO_CHAR(LOCALE_NAMES);
alter table REPORT_GROUP drop column LOCALE_NAMES;
alter table REPORT_GROUP rename column LOCALE_NAMES_2 to LOCALE_NAMES;

Another temporary solution may be to disable sorting by report group column in reports browser in case of Oracle.

Also the REPORT_REPORT column also has a CLOB LOCALE_NAMES column. The similar error could probably happens there as well.

Forum topic: https://forum.cuba-platform.com/t/error-sorting-reports-by-report-groupl/15807

gorbunkov commented 2 years ago

We've disabled sorting by "group" column in Reports browse screen in case of Oracle database