0

one column of my data frame contains pieces of text, characters is more than 255, when i use dbWritetable to oracle, i got this error:

    Error in .local(conn, statement, ...) : 
    execute JDBC update query failed in dbSendUpdate (ORA-12899: value too large for column "DWTEST"."PCP_DOCS"."WORDS" (actual: 341, maximum: 255)
    )

anyone can help? Thanks in advance

simonsong
  • 9
  • 2

2 Answers2

1

The column is capable of accepting only 255 characters. And you are trying to populate it with 341 characters. Hence, the error.

shruti1810
  • 3,920
  • 2
  • 16
  • 28
  • dbWriteTable(jdbcConnection, "temp", pcp_cust1) , one culumn of pcp_cust1 over the capable, how can i fix it, or any solution? thanks @shruti1810 – simonsong May 19 '15 at 06:57
  • In pcp_cust1, please check the values which are getting entered for the column which is throwing error. Please reduce the column contents. Or, in the database, increase the column size to `>341` for the column throwing error. – shruti1810 May 19 '15 at 07:02
1

ORA-12899: value too large for column "DWTEST"."PCP_DOCS"."WORDS" (actual: 341, maximum: 255)

The error means that the column WORDS in the table PCP_DOCS was created with a maximum limit of 255 characters. You are trying to update the column with a value having more than 255 characters, i.e. 341 characters, and thus the update is failing.

Assuming the column data type is VARCHAR2, you could modify the column to increase the size:

ALTER TABLE pcp_docs MODIFY (words VARCHAR2(500));

For example,

SQL> create table t(col varchar2(2));

Table created.

SQL>
SQL> insert into t values('abc');
insert into t values('abc')
                     *
ERROR at line 1:
ORA-12899: value too large for column "LALIT"."T"."COL" (actual: 3, maximum: 2)


SQL>
SQL> alter table t modify(col varchar2(10));

Table altered.

SQL>
SQL> insert into t values('abc');

1 row created.

SQL>
Lalit Kumar B
  • 47,486
  • 13
  • 97
  • 124