Sql script that compares two db,s and updates db and insert date of update
Hi i need some help creating an sql script that can update info from one table in dbase1 to another table in dbase2 that has the same columns and if posible insert date and time in one column when the syncronized is done? Can anyone help mee whit this?
help with creating the procedure
how can i create this query on a procedure:
Insert into COMPUSOFT.PESAJE@DB_2
(PSJ_GESTION, PSJ_COD, PSJ_PLACA, PSJ_PESO, PSJ_FECHA,
PSJ_ESTADO, BLZ_COD, MNF_COD, DMN_COD,
USR_COD, PSJ_OPERACION, TIC_COD, PSJ_TARA, PSJ_NETO)
select /*+ FULL(Tbl1) */
PSJ_GESTION, PSJ_COD, PSJ_PLACA, PSJ_PESO, PSJ_FECHA
, PSJ_ESTADO, BLZ_COD, MNF_COD, DMN_COD, USR_COD
, PSJ_OPERACION, TIC_COD, PSJ_TARA, PSJ_NETO
from COMPUSOFT.PESAJE Tbl1
where PSJ_OPERACION='IMP'
minus
select /*+ FULL(Tbl2) */
PSJ_GESTION, PSJ_COD, PSJ_PLACA, PSJ_PESO, PSJ_FECHA
, PSJ_ESTADO, BLZ_COD, MNF_COD, DMN_COD, USR_COD
, PSJ_OPERACION, TIC_COD, PSJ_TARA, PSJ_NETO
from COMPUSOFT.PESAJE@"DB_2" Tbl2
where PSJ_OPERACION='IMP';
plus i would like to insert also that when it runs the query also change a value in table pesaje column dmn_cod to "yes" default "no" in db_2
any help please???