ORA-00932: Inconsistent Datatypes: Expected NUMBER Got LONG

(Doc ID 1508340.1)

Last updated on NOVEMBER 09, 2017

Applies to:

Oracle Database Gateway for DRDA - Version 11.2.0.3 and later
Information in this document applies to any platform.

Symptoms

Using version 11.2.0.3 of the DRDA gateway with Oracle server 11.2.0.2, running on a Solaris 5.10 64 bit platform the following query throws this error
SELECT
  b.supp_num,
  TRIM(b.request_id) request_id,
  TO_TIMESTAMP(SUBSTR(b.note_dttm,1,24),'YYYY-MM-DD HH24:MI:SS:FF') note_dttm,
  TRIM(b.user_id) user_id,
  'GB2P_LRT151' source_system_cd,
  TRIM(a.purchase_ord_num) purchase_ord_num,
  TRIM(b.gui_note) gui_note
  FROM ilp.lrt002_request@gb2p.sbc.com a,
  ilp.lrt151_gui_notes@gb2p.sbc.com b
  WHERE a.supp_num = b.supp_num
  AND a.request_id = b.request_id
  AND company_code = '516C'
  AND NOTE_DTTM >= '2012-10-31 15:09:27'
  AND NOTE_DTTM <= '2012-10-31 15:09:33';

Error message:
ORA-00932: inconsistent datatypes: expected NUMBER got LONG
00932. 00000 - "inconsistent datatypes: expected %s got %s"

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms