Skip to Main Content

Data Science & Machine Learning

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error in .oci.WriteTable of ROracle package

3160710Sep 27 2016 — edited Sep 27 2016

0down votefavorite

The same topic is placed here - r - Error in .oci.WriteTable of ROracle package - Stack Overflow

I have found the error using 'dbWriteTable' and can not find any clue what way to handle it. The error is alike:

Error in .oci.WriteTable(conn, name, value, row.names = row.names, overwrite = overwrite, :

Error in .oci.GetQuery(con, stmt, data = value) : ORA-00913: too many values

I have got the Oracle table of such a structure (the extract from Oracle script):

create table My_table ( card_id    NUMBER(4), predictor  VARCHAR2(1000), interval   NUMBER(4), attributes VARCHAR2(1000), scoring    NUMBER(20,10), comments   VARCHAR2(1000), uploaded   DATE )

The dataframe contains only one row and the structure of it as follows (the R outpur of 'str' function - str(x)):

'data.frame':   1 obs. of  7 variables: $ CARD_ID   : int 36 $ PREDICTOR : chr "YEAR" $ INTERVAL  : int 1 $ ATTRIBUTES: chr ">= 1945 < 1960" $ SCORING   : int 7000 $ COMMENTS  : chr "no comments" $ UPLOADED  : Date, format: "2016-09-26"  

The script to establish connection is as follows:

drv <- dbDriver("Oracle") con <- dbConnect(drv, user, password, DB_name,bulk_read = rows_at_time)

The script to insert the dataframe into the Oracle table is as follows:

dbWriteTable(con, Oracle_table,  My_dataframe, row.names = FALSE, overwrite =   FALSE, append = TRUE, ora.number = TRUE, schema = NULL, date = FALSE )

So only dbWriteTable generate the following error:

Error in .oci.GetQuery(con, stmt, data = value) : ORA-00913: too many values

The structure of the tables is similar to the dataframe one.

The usage with other dataset and other Oracle table seems to be ok but not with this dataframe.

I would be glad to hear any hints how to handle this error.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2016
Added on Sep 27 2016
0 comments
404 views