Project

General

Profile

Bug #7841

Invalid conversion of temp table DMO when using clob/blob fields

Added by Alexandru Donica 8 months ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version:

start.p Magnifier (115 Bytes) Alexandru Donica, 09/26/2023 08:52 AM

table-blob.p Magnifier (869 Bytes) Alexandru Donica, 09/26/2023 08:52 AM

table-clob.p Magnifier (746 Bytes) Alexandru Donica, 09/26/2023 08:52 AM

History

#2 Updated by Alexandru Donica 8 months ago

I created 2 temp tables, in separate procedures, with the same table name, same field types with same field names, but one of them had a field 'lob' with type blob, and the other table had one with type clob. AFAIK, FWD tries to combine temp-tables with similar enough fields so as to not create many classes. However, FWD combined the 2 temp tables I created in a single class, but with only 1 of the 'lob' fields. The lob type seemed to depend on which of the 4GL procedures/files was converted last.

If the file with the clob was converted last, the Java class would have the 'lob' field as a clob. A clob managed to somewhat replace a blob in the example below, however, when exporting the lob to a file, it would use the writeClob() method in FileStream instead of writeBlob(). I imaged other discrepancies could arise with more testing (maybe when using a memptr/longchar).

To change the order of conversion for each file, i renamed one to be alphabetically before/after the other file. (like table-clob.p -> atable-clob.p).
The name must also be changed in the start.p file. If the file with the blob was converted last, in my example, after conversion, the program would try to assign a clob variable to a blob field, and would not even compile.

I used the method copy_lob from 4GL to take the value from a longchar into a blob. For a clob, I simply assigned it the value of a longchar.

#3 Updated by Alexandru Donica 8 months ago

Sorry, there is a typo in the file start.p, where I forgot to rename the procedure atable-clob.p to table-clob.p.
Either delete the letter 'a' or rename the file table-clob.p to atable-clob.p before running the code.

Also available in: Atom PDF