[R-sig-DB] problems with dbWriteTable in ROracle

Rajarshi Guha r@j@r@h|@guh@ @end|ng |rom gm@||@com
Sat Nov 28 22:19:47 CET 2009


Hi, I'm running ROracle (0.5-9) on R 2.9.0 (OS X 10.5.4) with Oracle 10g R2.

I have a data.frame which I'd like to insert into a table. If I construct
INSERT statements by hand, and use dbSendQuery, it works fine (but slow).
However, I tried to use dbWriteTable and I get the error below:

Error in oraExecStatement(ps, data, ...) :
  RS-DBI driver: (ORA-02005: implicit (-1) length not valid for this bind or
define datatype
)

I have also tried using a prepared statement and then usign dbExecStatement,
but I get the same error. Googling around for this specific Oracle error
doesn't turn up anything useful. The only possible reason I can think that'd
cause this error is the fact that the DB table has 32 columns, but the last
24 have default values and don't need to be specified at INSERT time. Thus
my manual INSERT looks like

insert into follow_pivot (protocol_name, npoint, row_idx, col_idx,
plate_series, seq, symbol, ncgcidr,
value01,value02,value03,value04,value05,value06,value07,value08,value09,value10)
values ('cpt-hdg-followup', 10, 1, 10, 'FCP112409-1',
'CACAGCCAGGACATCCTGGAA' 'RPSAP58',97788,
56.1732988189,55.9832217164,48.1326145496,28.5420717346,19.7739828032,21.8269105525,16.4192873455,14.6544541707,7.0792574342,4.6970933227)

Does the dbWriteTable method take into account that tjhe input data.frame
might not have all 32 columns, and do the INSERT appropriately?

Any pointers would be appreciated.

-- 
Rajarshi Guha
NIH Chemical Genomics Center

	[[alternative HTML version deleted]]




More information about the R-sig-DB mailing list