Oracle 9 and the new data type TIMESTAMP

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Oracle 9 and the new data type TIMESTAMP

Postby Ralf » Mon Nov 27, 2006 10:02 am

Hello All,

we use Oracle 9 and we have hat no Problems, but now we use the new data type TIMESTAMP and it's clear, the old framework can't not solve this type and we get an RTE in AbtOracl8DatabaseManager>>fieldForType:length:precision:scale:nullOk:
There are any solution for this problem?

Thanks
Ralf
Ralf
 
Posts: 41
Joined: Thu Nov 16, 2006 4:18 am

Postby tc » Mon Nov 27, 2006 5:13 pm

Hi Ralf,

That is correct, the current Oracle implementation supports DATE (SQLT_DAT), not TIMESTAMP.

However, there are 4 timestamp datatypes, did you want the plain vanilla TIMESTAMP?

Thanks.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Postby tc » Mon Nov 27, 2006 5:27 pm

Hi Ralf,

I forgot to point out that the implemetation of DATE can hold a date and timestamp.

Thanks.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

We need this type

Postby Ralf » Wed Nov 29, 2006 4:02 am

Hi tc,

thanks for your answer.:-) The situation is so: Our scheduler, written in java, need this field type because this field has microseconds. But, all tables are created under Smalltalk. So, I must find a Solution and is very simple. I have make a child class

AbtOracle8DatabaseManager subclass: #IfbAbtOracle8DatabaseManager

and overwritten the following class methode:

buildTypeDict
"Answer a newly constructed dictionary to map Oracle Internal datatypes returned by the
Oracle server to the appropriate Smalltalk field classes."
" AbtOracle8DatabaseManager
typeDict: nil;
typeDict: AbtOracle8DatabaseManager buildTypeDict. "


^( Dictionary new )
at: 1 put: AbtDatabaseVarCharField ; "VARCHAR2"
at: 2 put: IfbAbtOracle8DecimalField ; " Number "
at: 3 put: AbtDatabaseLongIntegerField ;
at: 4 put: AbtDatabaseDoubleFloatField ; " FLOAT"
at: 7 put: IfbAbtOracle8DecimalField ; " Number "
at: 8 put: AbtOracleLongField ; " LONG/LONG VARCHAR"
at: 9 put: AbtDatabaseVarCharField ; "VARCHAR"
at: 11 put: AbtDatabaseVarCharField ; "ROWID. These are treated as VARCHAR2 fields "
at: 12 put: IfbAbtOracleDateField ; "DATE"
at: 23 put: AbtOracleRawField ; "RAW"
at: 24 put: AbtOracleLongRawField ; " LONG RAW "
at: 96 put: AbtDatabaseFixedCharField ; "CHAR"
at: 187 put: IfbAbtOracleDateField;
" at: 105 put: AbtOracleMlsLabelField ; " " MLSLABEL "
" at: 111 put: AbtRefField;" " REF "
" at: 112 put: AbtCLOBField;" " CLOB "
" at: 113 put: abtBLOBField; " " BLOB"
yourself.

the bold marked code part is the TIMESTAMP field. We have under Smalltalk no problems, because the microseconds are trimmed in smalltalk and the tables for our Smalltalk parts and the tables for java parts are separated. Indeed, I must make two or three more changes, thats all. Although many thanks.

Best regards
Ralf

P.S. I hope, you can understand me, my english is not so good.:-)
Ralf
 
Posts: 41
Joined: Thu Nov 16, 2006 4:18 am

Postby tc » Thu Dec 07, 2006 8:44 pm

Hello,

I'll try to add that into the Oracle 10 classes before ST 7.5 is released. The class will probably be called something like AbtTimeStampField with a type of 187 which is an OCIDateTime.

Thanks.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest