Migrar los nombre de los Titulos Presupuestarios(cpdeftit)a partir de otra Tabla

De CidesaWiki

(Diferencias entre revisiones)
Saltar a navegación, buscar
 
Línea 10: Línea 10:
update cpdeftit
update cpdeftit
set nompre=
set nompre=
-
(select nompre from cpdeftit_2008 where trim(cpdeftit_2008.codpre)=substr(trim(cpdeftit.codpre),1,18))
+
(select nompre from cpdeftit_2008
 +
where
 +
length(trim(cpdeftit.codpre))<=18 and
 +
rpad(substr(cpdeftit.codpre,1,18),50,' ')=cpdeftit_2008.codpre)
 +
 
where exists
where exists
-
(select nompre from cpdeftit_2008 where trim(cpdeftit_2008.codpre)=substr(trim(cpdeftit.codpre),1,18))
+
(select nompre from cpdeftit_2008
 +
where
 +
length(trim(cpdeftit.codpre))<=18 and
 +
rpad(substr(cpdeftit.codpre,1,18),50,' ')=cpdeftit_2008.codpre)
</pre>
</pre>

Última versión de 14:57 15 ene 2008

01
01-01
01-01-01
01-01-01-01
01-01-01-01-01
01-01-01-01-01-401

update cpdeftit
set nompre=
(select nompre from cpdeftit_2008
where
length(trim(cpdeftit.codpre))<=18 and
rpad(substr(cpdeftit.codpre,1,18),50,' ')=cpdeftit_2008.codpre)

where exists
(select nompre from cpdeftit_2008
where
length(trim(cpdeftit.codpre))<=18 and
rpad(substr(cpdeftit.codpre,1,18),50,' ')=cpdeftit_2008.codpre)


--Jlobaton 15:54 10 ene 2008 (VET)

Herramientas personales
Espacios de nombres
Variantes
Acciones
Navegación
Herramientas