ora2pg map a column into 2 columns

56 views Asked by At

Is there a way to map a column into two columns? For example, in the source I have a column firstName and the destinazion i have a column firstName and lastName. I would like to split the source by the first space and move the firts part in the column firstName and the secont in the column lastName. For example, in the source I have a column firstName and the destination I have columns firstName and lastName. I would like to split the source by the first space and move the first part into the column firstName and the second in the column lastName. Or another example in the source i have a column lastUpdatedBy and in the destination I have lastUpdatedby and createdBy which I wanted to be equal to lastUpdatedBy. Or another example, in the source I have a column lastUpdatedBy and in the destination I have lastUpdatedby and createdBy which I wanted to be equal to lastUpdatedBy.

I looked up the ors2pg documentation and did not find anything suitable.

1

There are 1 answers

0
Jim Macaulay On

You have two options,

  1. You should go with ETL process, either export the data as required from Oracle and insert into PostgreSql.
select substr(name, 0, instr(name, ' ')) as first_name, substr(name, instr(name, ' ')) as last_name from 
(select 'Matthews John' as name from dual);
  1. Design a simple ETL script in Python to extract and insert into PostgreSql.

Migration tool does not perform ETL operations, they just migrate the data from one system to another having same structure