Blogia
tecnolakis

WSJ HISTORICO - INSERT RESTORE

Insertar en el historico de WSJ  con los  datos de  tablas  restaurada

 

insert into aranda.f986110 ( select substr(jcfndfuf2,1,instr(jcfndfuf2,’_’,1)-1) REPORT , substr ( jcfndfuf2, instr(jcfndfuf2,’_’,1,1) +1  , instr(jcfndfuf2,’_’,1,2) - instr(jcfndfuf2,’_’,1,1)-1 ) VERSION ,
to_date(SUBSTR(JCSBMDATE,2,6) || lpad(to_char(JCSBMTIME),6,’0’),’YYDDDHH24MISS’) SUBMIT,to_date(SUBSTR(JCACTDATE,2,6) || lpad(to_char(jcACTTIME),6,’0’),
’YYDDDHH24MISS’) LAST,(to_date(SUBSTR(JCACTDATE,2,6) || lpad(to_char(jcACTTIME),6,’0’),’YYDDDHH24MISS’) - to_date(SUBSTR(jcsbmdate,2,6) || lpad(to_char(jcsbmtime),6,’0’),’YYDDDHH24MISS’)) * 86400 seg ,
((to_date(SUBSTR(JCACTDATE,2,6) || lpad(to_char(jcACTTIME),6,’0’),’YYDDDHH24MISS’) - to_date(SUBSTR(jcsbmdate,2,6) || lpad(to_char(jcsbmtime),6,’0’),’YYDDDHH24MISS’)) * 86400 )/60 Min ,
((to_date(SUBSTR(JCACTDATE,2,6) || lpad(to_char(jcACTTIME),6,’0’),’YYDDDHH24MISS’) - to_date(SUBSTR(jcsbmdate,2,6) || lpad(to_char(jcsbmtime),6,’0’),’YYDDDHH24MISS’)) * 86400 )/3600 hs,
jcsbmdate,jcsbmtime,jcjobque ,jcuser ,jcexehost,jcjobnbr
from proarcdta.f986110@dbl_interfar_PD a
WHERE ( jcsbmdate >0 and jcsbmdate < 110365 )  and NOT EXISTS ( select  jcjobnbr,JCEXEHOST from aranda.f986110  B WHERE A.JCEXEHOST=B.JCEXEHOST and A.jcjobnbr=B.jcjobnbr  ) ) 

 

0 comentarios