hop of those help? Copying the triggers from one table to another can be done by copying DDL, and not updating all_triggers table. This can be done by using DBMS_METADATA. The closest practical example I found here: Copy Triggers when you Copy a Table
p_src_tbl varchar2(30):= 'PERSONS'; --your table name
p_trg_tbl varchar2(30):= 'PSN2'; --your trigger name
execute immediate 'create table '||p_trg_tbl||' as select * from '||p_src_tbl||' where 1=2';
for trg in (select trigger_name from user_triggers where table_name = p_src_tbl) loop
l_ddl:= cast(replace(replace(dbms_metadata.get_ddl( 'TRIGGER', trg.trigger_name),p_src_tbl,p_trg_tbl),trg.trigger_name,substr(p_trg_tbl||trg.trigger_name, 1, 30)) as varchar2);
execute immediate substr(l_ddl, 1, instr(l_ddl,'ALTER TRIGGER')-1);
it should still fix some issue You are confusing Apex and database concepts: triggers are part of the database, not of Apex. The syntax for the trigger would be:
CREATE OR REPLACE TRIGGER "DEFAULT_LOG_ENTRY" AFTER insert on "MAIN_APEX"
for each row
insert into apex_logs (log_entry, log_date, circulation,
values ('This log page was established. Actions and communcations are captured from this date and time onward.'
Is it good to create some intermediate table or directly use WITH query. Given that the table is a big table
this one helps. You should try it. Oracle does not (necessarily) materialize CTEs. That means that the entire query gets optimized, which no unnecessary reads and writes. In many cases, this results in a more efficient query plan.
can not insert row in a table while data redirecting from parent table to child table in trigger(stored procedure)
To fix the issue you can do I am using postgres version: PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit , My problem is solved in this way...
CREATE OR REPLACE FUNCTION insert_tsttbl1_hourbase() RETURNS TRIGGER AS $$
RAISE NOTICE 'Hi...%', NEW;
Execute 'set search_path to ' || TG_TABLE_SCHEMA|| '';
INSERT INTO tsttbl1_hour0 values (NEW.*);
$$ LANGUAGE plpgsql;
mysql select from table B where condition is not met on table B directly, but through join on table A