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

De CidesaWiki

(Diferencias entre revisiones)
Saltar a navegación, buscar
 
(4 ediciones intermedias no se muestran.)
Línea 1: Línea 1:
-
* Migra los Nombre Presupuestario siempre que se cumpla la condicion donde el Codigo=01-01-01-01-01-401
+
* Migra los Nombre Presupuestario siempre que se cumpla la condicion donde el Codigo llegue al nivel <br>
 +
01 <br>
 +
01-01 <br>
 +
01-01-01 <br>
 +
01-01-01-01 <br>
 +
01-01-01-01-01 <br>
 +
01-01-01-01-01-401 <br>
 +
<pre>
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>
--[[Usuario:Jlobaton|Jlobaton]] 15:54 10 ene 2008 (VET)
--[[Usuario:Jlobaton|Jlobaton]] 15:54 10 ene 2008 (VET)

Ú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