ora2pg icon indicating copy to clipboard operation
ora2pg copied to clipboard

ora2pg doesn't recognize overwritten data type while exporting data

Open jstmx opened this issue 5 months ago • 0 comments

Hi Gilles,

I've got 98% columns of type NUMBER(1) in oracle to be used as boolean representatives (1:0), So I used REPLACE_AS_BOOLEAN NUMBER:1 which worked as expected, Some columns are indeed used for small enums in the application, so I found the solution here to put such columns in MODIFY_TYPE list of form TABLE:COLUMN:smallint- this is working as well as expected. Now the problem is if I try to export the data from such table the data is encoded as f, t, 2, 3 etc. so seems ora2pg ignores MODIFY_TYPE property while determining export data format. Could you advice some solution here?

Updated: seems there is another one issue with TRANSFORM_VALUE parameter. it generates wrong SQL query:

FATAL: _extract_data() ORA-00904: "A"."REGEXP_REPLACE": invalid identifier (DBD ERROR: error possibly near <> indicator at char 126 i ... ,<>a.REGEXP_REPLACE("BODY_TYPE_LONG_NAME_DE",'o','u'),

it sets wrongly REGEXP_REPLACE function as a dot notation invoke of alias a, so oracle don't like it. It should be changed to , REGEXP_REPLACE(a."BODY_TYPE_LONG_NAME_DE",'o','u'),

Kind Regards Maksim

jstmx avatar Sep 19 '24 14:09 jstmx