I've installed Oracle 10g XE on my Windows machine for some testing.
I've made a DataSource to the Oracle DB through ODBC
In RB2007r2 I'm using an ODBCDatabase and have successfully connected
to the DataSource.
Now I'm trying to add a record to a table using DatabaseRecord class.
My first field is a NUMERIC
My second field is a TIMESTAMP
in code I do this
dim localDate as Date
localDate = new Date
myDR = new DatabaseRecord
myDR.IntegerColumn("""RecordID""") = x
myDR.DateColumn(""RecordDateTime""") = localDate
myDB.InsertRecord("""myTable""",myDR)
myDB.commit
This will not insert a record since I get an error back from
InsertRecord call that says
"[Oracle][ODBC][Ora]ORA-01843: not a valid month"
so I switch to
myDR = new DatabaseRecord
myDR.IntegerColumn("""RecordID""") = x
myDR.Column(""RecordDateTime""") = localDate.SQLDateTime
myDB.InsertRecord("""myTable""",myDR)
myDB.commit
Still get an error, this time it's
the only thing that seems to work is to actually do is to create a
string in the Date/Time
format Oracle seems to expect DD-MMM-YY HH:MM:SSAM/PM
i.e.
myDR.Column("""RecordDateTime""") = "20-APR-07 11:42:00 AM"
This then would work.
Am I missing something? Seems dumb I'd have to make a DB specific
change to go through ODBC.
Dean Davis
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>