Here is sql-query: select t1.id, t1.rep_id1, t1.rep_id2, t1.proc_name, t1.proc_result, t1.descr from cnfl_szd_rep_add t1, (select min(id) rep_id1, max(id) rep_id2 from cnfl_implement_rep where trunc(report_date)=trunc(:p_date)) t2 where t1.rep_id1=t2.rep_id1 and t1.rep_id2=t2.rep_id2 Here is structure of the table cnfl_implement_rep: create table CNFL_IMPLEMENT_REP ( id NUMBER not null, insert_date DATE, report_date DATE, staff_id NUMBER, app_ver NUMBER, staff_begin DATE, staff_end DATE, day_night VARCHAR2(10), tsa_info CLOB, rep_gbr CLOB, is_deleted INTEGER default 0); Here is structure of the table cnfl_szd_rep_add: create table CNFL_SZD_REP_ADD ( id NUMBER not null, rep_id1 NUMBER, rep_id2 NUMBER, proc_name VARCHAR2(4000), proc_result VARCHAR2(4000), descr VARCHAR2(4000)); I have created datasource definition, have chosen that it is based on Query, have created bind variable p_date with domain DefaultDate and I get error message 'ORA-00932: inconsistent datatypes: expected DATE got NUMBER' when I press OK button to save the datasource definition. Why do I get such error message? |
This is a typical error that occurs when you have an api call like api_datasource.getColumnValueNR('DataSource.Field') and the field type does not correspond with that NR (number) from getColumnValueNR. It shoud be getColumnValueDT if the field type is DATE, getColumnValueTX if the fied type is VARCHAR2 and getColumnValueNR if the field type is NUMBER. Hope this helped. Cezar |