Link to home
Start Free TrialLog in
Avatar of Allen Pitts
Allen PittsFlag for United States of America

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.FLIP_END_TIME.

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_HIST
(CCM_FLIP_COMPONENT_HIST.OLD_COMPONENT_ID, CCM_FLIP_COMPONENT_HIST.NEW_COMPONENT_ID, CCM_FLIP_COMPONENT_HIST.FLIP_START_TIME, CCM_FLIP_COMPONENT_HIST.FLIP_INITIATED_BY)
SELECT
(WRK_COMP_FLIP_REQ.OLD_COMPONENT_ID, WRK_COMP_FLIP_REQ.NEW_COMPONENT_ID, WRK_COMP_FLIP_REQ.FLIP_DATE, WRK_COMP_FLIP_REQ.FLIP_DATE, WRK_COMP_FLIP_REQ.FLIP_USER)
FROM CCM.WRK_COMP_FLIP_REQ
where CCM_FLIP_COMPONENT_HIST.FLIP_START_TIME < '11-OCT-15';
CCM-2675-SQL_dev.xlsx
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial