Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
Numeric Overflow while converting oracle to PostgreSQL

I am converting a very old Oracle DB to Postgres where most of the precision of the numeric columns are missing, however, In Postgres table structure the precision to the same columns are present, I am getting a plethora of numeric overflow error while moving data from Oracle DB to Postgres.

Now, I want to update all those out of precision values to the largest number of the precision in the oracle database, so, I am trying to create an update script using a Postgres table structure that can help me to find all the damaged rows in the oracle.

My query is as below(to be run on Postgres), that I want to modify to get the update script which I can run on oracle DB to get the corrupt values.

select 'update ' ||table_name || 'set ' || column_name || '=' || (numeric_precision - numeric_scale) || ' where column_name > ' || (numeric_precision - numeric_scale) from information_schema.columns where table_schema='test' and data_type='numeric';

Now here (numeric_precision - numeric_scale) if it returns a value 3 then I want to replace it with 999 in case if it is 4 then I want it to be 9999.

Please can someone let me know how this is possible, I want to run this query on Postgres DB and then I will run the resulting script on the Oracle DB?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You could use the length of your (numeric_precision - numeric_scale) result for add the pattern you prefer using LPAD

LPAD('', length((numeric_precision - numeric_scale)), '9' )
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda