Re: Oracle database into PostgreSQL using Ora2PG tool.

From: stevenchang1213 <stevenchang1213(at)gmail(dot)com>
To: PAWAN SHARMA <er(dot)pawanshr0963(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Oracle database into PostgreSQL using Ora2PG tool.
Date: 2017-06-02 15:57:24
Message-ID: 59318ae9.4aca620a.d4cfe.b478@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

tell me where this function add_job_history() is?Actually, I don't think you can count on ora2pg to transform your pl/sql code to plpgsql or other (un)trusted procedural language code. It's not that simple!you can type "\df  add_job_history"  in psql session to check it's existence if it belongs to public schema or access it using fully qualified name scheme.

Steven
從我的 Samsung Galaxy 智慧型手機傳送。
-------- 原始訊息 --------自: PAWAN SHARMA <er(dot)pawanshr0963(at)gmail(dot)com> 日期: 2017/6/2 16:16 (GMT+08:00) 至: pgsql-general(at)postgresql(dot)org 主旨: [GENERAL] Oracle database into PostgreSQL using Ora2PG tool.
Hi All,
I am migrating Oracle database into PostgreSQL using Ora2PG tool.
So, I am facing one issue with trigger after generating script output of Oracle database.
Oracle : 
CREATE OR REPLACE TRIGGER UPDATE_JOB_HISTORY     AFTER UPDATE OF JOB_ID, DEPARTMENT_ID ON EMPLOYEES     FOR EACH ROW BEGIN  add_job_history(:old.employee_id, :old.hire_date, sysdate,                  :old.job_id, :old.department_id);END; / 
The script generated by Ora2PG tool.
DROP TRIGGER IF EXISTS update_job_history ON employees CASCADE;
CREATE OR REPLACE FUNCTION trigger_fct_update_job_history() RETURNS trigger AS $BODY$BEGIN  add_job_history(OLD.employee_id, OLD.hire_date, LOCALTIMESTAMP,                  OLD.job_id, OLD.department_id);RETURN NEW;END$BODY$ LANGUAGE 'plpgsql';
CREATE TRIGGER update_job_history AFTER UPDATE ON employees FOR EACH ROW EXECUTE PROCEDURE trigger_fct_update_job_history();

when I try to run the above-generated script it will show below error.
ERROR:  syntax error at or near "add_job_history"LINE 4:   add_job_history(OLD.employee_id, OLD.hire_date, LOCALTIMES...          ^NOTICE:  relation "employees" does not exist, skipping

Please Suggest or help to resolve it.
-Pawan

 

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Neil Anderson 2017-06-02 16:31:28 Re: dump to pg
Previous Message Juliano 2017-06-02 14:03:13 Re: repmgr cascade replication node delay