Oracle dataserver/temp tables/buffer-copy

NickA

Member
Help! :errr:

Progress 8.3

We're running our standard interface routine (Developed in the 4GL) to an intermediate Oracle database for the first time.

Part of the interface code copies a record from a table in the Oracle DB to a Progress TEMP-TABLE (Defined with LIKE) using BUFFER-COPY.

There seems to be some issue with date fields?

I know, for absolutely certain, that the values in the date fields are for the year '2002', and can generally be viewed as such using the 4GL to query the table directly. For some reason the buffer-copy from the live record to the temp table results in dates with the year set to '1950'.

Has anybody ever heard of this? I've got a very impatient customer with a non-functional interface..

TIA
 

NickA

Member
Answer from George Potemkin on the PEG (Thanks George)

Issue #20001130-009, Oracle DataServer

When your run BUFFER-COPY against a table that has a date field and the time portion as well (field-1), the date in the buffer has the wrong date.

Fixed in 9.1B06.
 

NickA

Member
Ah, actually, this is how you fix it

For future reference... the problem didn't originate with the BUFFER-COPY - it originated with the definition of the temp table. You must not define a temp table LIKE an Oracle table if it contains dates/times or it all goes terribly wrong.

EG

Code:
DEFINE TEMP-TABLE tWMS_TRANSFER
    FIELD TRN_TRANS_TIME   AS DATE
    FIELD TRN_TRANS_TIME-1 AS INTEGER
    ...

NOT..

Code:
DEFINE TEMP-TABLE tWMS_TRANSFER LIKE WMS_TRANSFER
 
Top