Skip to content

I've Question for replace_query #1969

Description

@pcouas

Hello,
In my select all oracle fields are not present
So i have an error with insert on no mapping fields

[2026-07-15 12:42:08] FATAL: ERROR: column "date_maj" of relation "personal_info" does not exist
LINE 1: INSERT INTO personal_info (date_maj,user_maj,type_maj,matric...
=> this column name only exist on oracle side, my goal is to concat two fields

Regards

#fichier de configuration des bases
########################################

Connexion Oracle

########################################
ORACLE_DSN
ORACLE_USER
ORACLE_PWD

########################################

Connexion PostgreSQL

########################################

PG_DSN
PG_USER
PG_PWD

########################################

Table cible PostgreSQL

########################################
#local
#PG_VERSION 18

#cae
PG_SCHEMA ora2pg
PG_VERSION 17

EXCLUDE_SEQUENCE *
EXCLUDE_TRIGGER *
EXCLUDE_INDEX *
EXCLUDE_CONSTRAINT *

########################################

Type d'export

########################################
TYPE INSERT
DATA_ONLY 1

########################################

Gestion des doublons PostgreSQL

on n'insere PAS les doublons

########################################
INSERT_ON_CONFLICT 1

########################################

Format des dates

########################################
DATA_TYPE TIMESTAMP
ORACLE_DATE_FORMAT YYYY-MM-DD HH24:MI:SS.FF3

########################################

Options performance

########################################
MULTI_INSERT 500
BULK_INSERT 1
COMMIT 1000

########################################

Exécution directe (pas de fichier)

########################################
OUTPUT /dev/null

TABLES indiv

nouveau nom de la table

REPLACE_TABLES indiv:personal_info

colonnes cibles PostgreSQL

COLUMNS personal_info:hr_email,mig_matricule,mig_rank,mig_datemaj,mig_mobileprivepays,mig_mobileprive,mig_mobilepropays,mig_mobilepro,mig_fixeprivepays,mig_fixeprive,mig_fixepropays,mig_fixepro,home_phone,work_phone,home_phone2,work_phone2

########################################

Requête personnalisée Oracle

=> priorité au SELECT

########################################
REPLACE_QUERY indiv[
SELECT
a.MAIL_RH AS hr_email,
a.MATRICULE AS mig_matricule,
a.RANG AS mig_rank,
a.DATE_MAJ AS mig_datemaj,
a.MOBILE_PRIVE_INDPAYS AS mig_mobileprivepays,
a.MOBILE_PRIVE AS mig_mobileprive,
a.MOBILE_PRO_INDPAYS AS mig_mobilepropays,
a.MOBILE_PRO AS mig_mobilepro,
a.FIXE_PRIVE_INDPAYS AS mig_fixeprivepays,
a.FIXE_PRIVE AS mig_fixeprive,
a.FIXE_PRO_INDPAYS AS mig_fixepropays,
a.FIXE_PRO AS mig_fixepro,
a.MOBILE_PRIVE_INDPAYS || ' ' || a.MOBILE_PRIVE AS home_phone,
a.MOBILE_PRO_INDPAYS || ' ' || a.MOBILE_PRO AS work_phone,
a.MOBILE_PRIVE_INDPAYS || ' ' || a.MOBILE_PRIVE AS home_phone2,
a.MOBILE_PRO_INDPAYS || ' ' || a.MOBILE_PRO AS work_phone2
FROM indiv a
WHERE a.RANG = '0'
ORDER BY a.DATE_MAJ DESC
]

LOGFILE info_perso_ora2pg.log

Optionnel

TRUNCATE_TABLE 1

DEBUG 1

Activity

  1. darold commented on Sep 27, 2026

    @darold
    Owner

    Multiline value for an ora2pg configuration setting is not allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions