I want to do a script that retrieves all the data in the table COURBE_CHARGE to copy them to the table with HISTORIQUE_COURBE_CHARGE measurement date (the field CCH_DATE) that is either earlier than 14 months, and that removes the copied data.
COURBE_CHARGE and HISTORIQUE_COURBE_CHARGE is the same table
COURBE_CHARGE:
Column Data Type
CCH_ID NUMBER(*,0)
TLM_ID NUMBER(*,0)
CPT_ID NUMBER(*,0)
CCH_DATE DATE
CCH_DATE_INTEGRATION DATE
CCH_NEW NUMBER(*,0)
CCH_NB_HEURES NUMBER(*,0)
CCH_TYPE_ENERGIE VARCHAR2(12)
P1 NUMBER(*,0)
P2 NUMBER(*,0)
P3 NUMBER(*,0)
… NUMBER(*,0)
P149 NUMBER(*,0)
P150 NUMBER(*,0)
PH1 NUMBER(*,0)
PH2 NUMBER(*,0)
… NUMBER(*,0)
PH24 NUMBER(*,0)
PH25 NUMBER(*,0)
HISTORIQUE_COURBE_CHARGE:
Column Data Type
HIS_CCH_ID NUMBER(*,0)
TLM_ID NUMBER(*,0)
CPT_ID NUMBER(*,0)
CCH_DATE DATE
CCH_DATE_INTEGRATION DATE
CCH_NEW NUMBER(*,0)
CCH_NB_HEURES NUMBER(*,0)
CCH_TYPE_ENERGIE VARCHAR2(12)
P1 NUMBER(*,0)
P2 NUMBER(*,0)
P3 NUMBER(*,0)
… NUMBER(*,0)
P149 NUMBER(*,0)
P150 NUMBER(*,0)
PH1 NUMBER(*,0)
PH2 NUMBER(*,0)
… NUMBER(*,0)
PH24 NUMBER(*,0)
PH25 NUMBER(*,0)
I have an error when i execute my script

Thanks.
[Field list] should be expanded to the full field list of your tables. (eg. P1, P2, P3…) without the CH_DATE
The where cond: 14 months are roughly 425 days, adjust the condition if you need exactly 14 months.
EDIT: please note that ch_date will be set to SYSDATE in historical table, that can be right or wrong, depending on situation, if you need to keep track of when archiviation has been actually done (but I suggest you to add a new date column HIST_DATE and use it to store SYSDATE). In that scenario insert will be:
ALTER TABLE HISTORIQUE_COURBE_CHARGE ( ADD HIST_DATE DATE ); — execute this only once
In this case, [field list] is the whole field list of the table. Likewise you can store other informations (such as user performing the storicization and so on).
for the deletion:
this will delete each saved row.