[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2352
  • Last Modified:

java.sql.SQLException: ORA-01401: inserted value too large for column

hi!

I am trying to insert data and having this error.
java.sql.SQLException: ORA-01401: inserted value too large for column

I debugged and watched all variables in details by using debug utility in eclipse, but couldn’t find any problem. I was able to insert data to another similar table though.

IfThanks for any comments.
+++++++++++++++++++++
create table DEMOGRAPHICS(
  demographics_id                  number(7)  primary key,
  JHH_ID_NUM            NUMBER(8)  NOT NULL,
  LDRC_ID                             number(4)  not null,
  A_MRI_NUM             number(4) not null,
  F_MRI_NUM             number(4) NOT NULL,
  PROJ_SBJ_NUM            number(4) NOT NULL,
  DAD_DB_ID            VARCHAR2(8)  NOT NULL,
  MOM_DB_ID            VARCHAR2(8)  NOT NULL,
  SIBLING_DB_ID            VARCHAR2(8)  NOT NULL,
  PREFIX                        VARCHAR2(4) NOT NULL,
  FIRST_NAME            VARCHAR2(20) NOT NULL,
  MIDDLE_NAME            VARCHAR2(20) NOT NULL,
  LAST_NAME            VARCHAR2(30) NOT NULL,
  SUFFIX                        VARCHAR2(4) NOT NULL,
  MAIDEN_NAME            VARCHAR2(30) NOT NULL,
  SEX                              VARCHAR2(8) NOT NULL,
  DOB                              date NOT NULL,
  RACE                  VARCHAR2(16) NOT NULL,
  LANGUAGE            VARCHAR2(12) NOT NULL,
  SES                  VARCHAR2(8) NOT NULL,
  PRIMARY_DX            VARCHAR2(20) NOT NULL,
  ADHD_SUBTYPE            VARCHAR2(12) NOT NULL,
  SECONDARY_DX            VARCHAR2(20) NOT NULL,
  DX_NOTES            VARCHAR2(255),
  NOTES                  VARCHAR2(255)
 
);
0
dkim18
Asked:
dkim18
  • 2
1 Solution
 
mjhatcherCommented:
What command are you entering to get that error?

It suggests you're trying to put in a number or varchar too wide. What data are you trying to insert?
0
 
dkim18Author Commented:
That is what I thought first, so I tried one or couple of numeric value for number fields and a few string for varchar fields and again, I used debug utility and watched all variables and detail, but couldn't find any problem...

+++++++++++++++++++++++++=
              String insertSql = "INSERT INTO DEMOGRAPHICS" +
        "(jhh_id_num" +
           ",ldrc_id" +
               ",a_mri_num" +
               ",f_mri_num" +
               ",proj_sbj_num" +
               ",dad_db_id" +
               ",mom_db_id" +
               ",sibling_db_id" +
               ",prefix" +
               ",first_name" +
               ",middle_name" +
               ",last_name" +
               ",suffix" +
               ",maiden_name" +
               ",sex" +
               ",dob" +
               ",race" +
               ",language" +
               ",ses" +
               ",primary_dx" +
               ",adhd_subtype" +
               ",secondary_dx" +
               ",dx_notes" +
               ",notes" +  //24
               ",demographics_id)"+
               " VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,TO_DATE(?,'MM/DD/YYYY'),?,?,?,?,?,?,?,?,demographics_id_seq.nextval)";//24
               
               insertGps.set(type, demographics.getJHHID());
               insertGps.set(type, demographics.getLdrcID());
            insertGps.set(type, demographics.getAMRI());
            insertGps.set(type, demographics.getFMRI());
...
...
0
 
dkim18Author Commented:
I found error. One of the drop down options contain more than 12 varchar. It was long menu and I missed that...
thanks anyway.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now