stefan.ulrych@ubs.com
2004-Oct-20 15:07 UTC
[R] Inserting Date Field into Oracle table using ROracle
It is possible to insert date and time information as a character string into an Oracle DATE data type with ROracle. In an older e-mail it has been stated that it is only possible to insert the date as a string into a DATE field. The solution is as follows: Before inserting the character string the default value for the NLS_DATE_FORMAT must be changed in Oracle, e.g. ... res<-dbSendQuery(con,"alter session set NLS_DATE_FORMAT = 'dd-mm-yyyy hh24:mi:ss'") dbClearResult(res) ... After you have processed these commands you can insert a character string that matches the above format into an Oracle DATE data field with the dbPrepareStatement and dbExecStatement commmands. You can define also other formats using the Oracle date and time format rules. Regards Stefan Ulrych Visit our website at ubs.com This message contains confidential information and is intend...{{dropped}}