Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ora2pg doesn't recognize overwritten data type while exporting data #1820

Open
jstmx opened this issue Sep 19, 2024 · 0 comments
Open

ora2pg doesn't recognize overwritten data type while exporting data #1820

jstmx opened this issue Sep 19, 2024 · 0 comments

Comments

@jstmx
Copy link

jstmx commented Sep 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant