Allen Pitts
asked on
PL/SQL MOve data from table to another 151117
Hello experts,
We have a table called WRK_COMP_FLIP_REQ and a table called CCM_FLIP_COMPONENT_HIST.
We need to move the data newer than 11-OCT-2015 from WRK_COMP_FLIP_REQ to CCM_FLIP_COMPONENT_HIST.
Table attached shows tables names, Columns names and datatypes.
Pretty simple. Have written script, copied herewith below, that (I think) will do the job.
The only fly in the ointment is we want to insert the record named WRK_COMP_FLIP_REQ .FLIP_DATE into
CCM_FLIP_COMPONENT_HIST. FLIP_START_TIME and CCM_FLIP_COMPONENT_HIST.FL IP_END_TIM E.
The script written just selects WRK_COMP_FLIP_REQ .FLIP_DATE twice and inserts it the targe table according
to the sequence of columns. Will this work?
Thanks.
Allen in Dallas
INSERT INTO CCM.CCM_FLIP_COMPONENT_HIS T
(CCM_FLIP_COMPONENT_HIST.O LD_COMPONE NT_ID, CCM_FLIP_COMPONENT_HIST.NE W_COMPONEN T_ID, CCM_FLIP_COMPONENT_HIST.FL IP_START_T IME, CCM_FLIP_COMPONENT_HIST.FL IP_INITIAT ED_BY)
SELECT
(WRK_COMP_FLIP_REQ.OLD_COM PONENT_ID, WRK_COMP_FLIP_REQ.NEW_COMP ONENT_ID, WRK_COMP_FLIP_REQ.FLIP_DAT E, WRK_COMP_FLIP_REQ.FLIP_DAT E, WRK_COMP_FLIP_REQ.FLIP_USE R)
FROM CCM.WRK_COMP_FLIP_REQ
where CCM_FLIP_COMPONENT_HIST.FL IP_START_T IME < '11-OCT-15';
CCM-2675-SQL_dev.xlsx
We have a table called WRK_COMP_FLIP_REQ and a table called CCM_FLIP_COMPONENT_HIST.
We need to move the data newer than 11-OCT-2015 from WRK_COMP_FLIP_REQ to CCM_FLIP_COMPONENT_HIST.
Table attached shows tables names, Columns names and datatypes.
Pretty simple. Have written script, copied herewith below, that (I think) will do the job.
The only fly in the ointment is we want to insert the record named WRK_COMP_FLIP_REQ .FLIP_DATE into
CCM_FLIP_COMPONENT_HIST. FLIP_START_TIME and CCM_FLIP_COMPONENT_HIST.FL
The script written just selects WRK_COMP_FLIP_REQ .FLIP_DATE twice and inserts it the targe table according
to the sequence of columns. Will this work?
Thanks.
Allen in Dallas
INSERT INTO CCM.CCM_FLIP_COMPONENT_HIS
(CCM_FLIP_COMPONENT_HIST.O
SELECT
(WRK_COMP_FLIP_REQ.OLD_COM
FROM CCM.WRK_COMP_FLIP_REQ
where CCM_FLIP_COMPONENT_HIST.FL
CCM-2675-SQL_dev.xlsx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.