0

I'm getting the error "ORA-00932: inconsistent datatypes: expected UDT got CHAR" when trying to insert data into my table through application express.

My Table:

CREATE TABLE "TEST"."PERSONS" 
(   "PERSON_ID" NUMBER, 
"PERSON_NAME" VARCHAR2(50 BYTE), 
"SURNAME" VARCHAR2(50 BYTE), 
 CONSTRAINT "PERSONS_PERSON_ID_PK" PRIMARY KEY ("PERSON_ID"));

When I try:

INSERT INTO PERSONS (PERSON_ID, PERSON_NAME, SURNAME)
VALUES (8, 'Tony', 'Smith');

It works in sql devoloper but not application express. How can I resolve this?

  • 2
    Try `INSERT INTO TEST.PERSONS...`. – FDavidov Dec 18 '16 at 07:19
  • Do you need to declare `PERSON_NAME` and `SURNAME` as `BYTE` instead of `CHAR`? Because, declaring with `BYTE` notation is problematic. Check this [question](http://stackoverflow.com/questions/81448/difference-between-byte-and-char-in-column-datatypes). To resolve your issue you can opt for `varchar2(50 char)`. – bprasanna Dec 18 '16 at 08:26
  • Byte is only problematic if you're not coding accordingly. Both options there for a reason, and I don't see why it should be a problem here. Need more info on how it's used in APEX – Scott Dec 19 '16 at 08:26

0 Answers0