![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
... continuacion
select sum(programado) into v_manopene from manoobra_obra where fechavencimiento like p_anio||'/01/__' and noobra=v_noobra; select sum(programado) into v_manopfeb from manoobra_obra where fechavencimiento like p_anio||'/02/__' and noobra=v_noobra; select sum(programado) into v_manopmar from manoobra_obra where fechavencimiento like p_anio||'/03/__' and noobra=v_noobra; select sum(programado) into v_manopabr from manoobra_obra where fechavencimiento like p_anio||'/04/__' and noobra=v_noobra; select sum(programado) into v_manopmay from manoobra_obra where fechavencimiento like p_anio||'/05/__' and noobra=v_noobra; select sum(programado) into v_manopjun from manoobra_obra where fechavencimiento like p_anio||'/06/__' and noobra=v_noobra; select sum(programado) into v_manopjul from manoobra_obra where fechavencimiento like p_anio||'/07/__' and noobra=v_noobra; select sum(programado) into v_manopago from manoobra_obra where fechavencimiento like p_anio||'/08/__' and noobra=v_noobra; select sum(programado) into v_manopsep from manoobra_obra where fechavencimiento like p_anio||'/09/__' and noobra=v_noobra; select sum(programado) into v_manopoct from manoobra_obra where fechavencimiento like p_anio||'/10/__' and noobra=v_noobra; select sum(programado) into v_manopnov from manoobra_obra where fechavencimiento like p_anio||'/11/__' and noobra=v_noobra; select sum(programado) into v_manopdic from manoobra_obra where fechavencimiento like p_anio||'/12/__' and noobra=v_noobra; select sum(real) into v_manorene from manoobra_obra where fechavencimiento like p_anio||'/01/__' and noobra=v_noobra; select sum(real) into v_manorfeb from manoobra_obra where fechavencimiento like p_anio||'/02/__' and noobra=v_noobra; select sum(real) into v_manormar from manoobra_obra where fechavencimiento like p_anio||'/03/__' and noobra=v_noobra; select sum(real) into v_manorabr from manoobra_obra where fechavencimiento like p_anio||'/04/__' and noobra=v_noobra; select sum(real) into v_manormay from manoobra_obra where fechavencimiento like p_anio||'/05/__' and noobra=v_noobra; select sum(real) into v_manorjun from manoobra_obra where fechavencimiento like p_anio||'/06/__' and noobra=v_noobra; select sum(real) into v_manorjul from manoobra_obra where fechavencimiento like p_anio||'/07/__' and noobra=v_noobra; select sum(real) into v_manorago from manoobra_obra where fechavencimiento like p_anio||'/08/__' and noobra=v_noobra; select sum(real) into v_manorsep from manoobra_obra where fechavencimiento like p_anio||'/09/__' and noobra=v_noobra; select sum(real) into v_manoroct from manoobra_obra where fechavencimiento like p_anio||'/10/__' and noobra=v_noobra; select sum(real) into v_manornov from manoobra_obra where fechavencimiento like p_anio||'/11/__' and noobra=v_noobra; select sum(real) into v_manordic from manoobra_obra where fechavencimiento like p_anio||'/12/__' and noobra=v_noobra; let v_totpene=v_matpene+v_manopene; let v_totrene=v_matrene+v_manorene; let v_totpfeb=v_matpfeb+v_manopfeb; let v_totrfeb=v_matrfeb+v_manorfeb; let v_totpmar=v_matpmar+v_manopmar; let v_totrmar=v_matrmar+v_manormar; let v_totpabr=v_matpabr+v_manopabr; let v_totrabr=v_matrabr+v_manorabr; let v_totpmay=v_matpmay+v_manopmay; let v_totrmay=v_matrmay+v_manormay; let v_totpjun=v_matpjun+v_manopjun; let v_totrjun=v_matrjun+v_manorjun; let v_totpjul=v_matpjul+v_manopjul; let v_totrjul=v_matrjul+v_manorjul; let v_totpago=v_matpago+v_manopago; let v_totrago=v_matrago+v_manorago; let v_totpsep=v_matpsep+v_manopsep; let v_totrsep=v_matrsep+v_manorsep; let v_totpoct=v_matpoct+v_manopoct; let v_totroct=v_matroct+v_manoroct; let v_totpnov=v_matpnov+v_manopnov; let v_totrnov=v_matrnov+v_manornov; let v_totpdic=v_matpdic+v_manopdic; let v_totrdic=v_matrdic+v_manordic; let v_mat='Materiales'; let v_mo='Mano de obra'; let v_tot='Totales'; let v_matp='P'; let v_matr='R'; let v_mop='P'; let v_mor='R'; let v_totp='P'; let v_totr='R'; return v_nomzona, v_obra, v_anio, v_mat, v_mo, v_tot, v_matp, v_matr, v_mop, v_mor, v_totp, v_totr, v_matpene, v_matrene, v_matpfeb, v_matrfeb, v_matpmar, v_matrmar, v_matpabr, v_matrabr, v_matpmay, v_matrmay, v_matpjun, v_matrjun, v_matpjul, v_matrjul, v_matpago, v_matrago, v_matpsep, v_matrsep, v_matpoct, v_matroct, v_matpnov, v_matrnov, v_matpdic, v_matrdic, v_manopene, v_manorene, v_manopfeb, v_manorfeb, v_manopmar, v_manormar, v_manopabr, v_manorabr, v_manopmay, v_manormay, v_manopjun, v_manorjun, v_manopjul, v_manorjul, v_manopago, v_manorago, v_manopsep, v_manorsep, v_manopoct, v_manoroct, v_manopnov, v_manornov, v_manopdic, v_manordic, v_totpene, v_totrene, v_totpfeb, v_totrfeb, v_totpmar, v_totrmar, v_totpabr, v_totrabr, v_totpmay, v_totrmay, v_totpjun, v_totrjun, v_totpjul, v_totrjul, v_totpago, v_totrago, v_totpsep, v_totrsep, v_totpoct, v_totroct, v_totpnov, v_totrnov, v_totpdic, v_totrdic with resume; end foreach; END PROCEDURE; |
|
#2
|
|||
|
|||
|
LA OTRA FUNCION (que se resuelve en 12 min)
DROP FUNCTION avanceobrascosto(char); CREATE PROCEDURE "informix".avanceobrascosto(p_anio char(4)) RETURNING char(50) as nombrezona, char(500) as obra, integer as anio, char(50) as mat, char(50) as mo, char(50) as tot, char(2) as matp, char(2) as matr, char(2) as mop, char(2) as mor, char(2) as totp, char(2) as totr, decimal(16,2) as cosmatpene, decimal(16,2) as cosmatrene, decimal(16,2) as cosmatpfeb, decimal(16,2) as cosmatrfeb, decimal(16,2) as cosmatpmar, decimal(16,2) as cosmatrmar, decimal(16,2) as cosmatpabr, decimal(16,2) as cosmatrabr, decimal(16,2) as cosmatpmay, decimal(16,2) as cosmatrmay, decimal(16,2) as cosmatpjun, decimal(16,2) as cosmatrjun, decimal(16,2) as cosmatpjul, decimal(16,2) as cosmatrjul, decimal(16,2) as cosmatpago, decimal(16,2) as cosmatrago, decimal(16,2) as cosmatpsep, decimal(16,2) as cosmatrsep, decimal(16,2) as cosmatpoct, decimal(16,2) as cosmatroct, decimal(16,2) as cosmatpnov, decimal(16,2) as cosmatrnov, decimal(16,2) as cosmatpdic, decimal(16,2) as cosmatrdic, decimal(16,2) as cosmanopene, decimal(16,2) as cosmanorene, decimal(16,2) as cosmanopfeb, decimal(16,2) as cosmanorfeb, decimal(16,2) as cosmanopmar, decimal(16,2) as cosmanormar, decimal(16,2) as cosmanopabr, decimal(16,2) as cosmanorabr, decimal(16,2) as cosmanopmay, decimal(16,2) as cosmanormay, decimal(16,2) as cosmanopjun, decimal(16,2) as cosmanorjun, decimal(16,2) as cosmanopjul, decimal(16,2) as cosmanorjul, decimal(16,2) as cosmanopago, decimal(16,2) as cosmanorago, decimal(16,2) as cosmanopsep, decimal(16,2) as cosmanorsep, decimal(16,2) as cosmanopoct, decimal(16,2) as cosmanoroct, decimal(16,2) as cosmanopnov, decimal(16,2) as cosmanornov, decimal(16,2) as cosmanopdic, decimal(16,2) as cosmanordic, decimal(16,2) as totpene, decimal(16,2) as totrene, decimal(16,2) as totpfeb, decimal(16,2) as totrfeb, decimal(16,2) as totpmar, decimal(16,2) as totrmar, decimal(16,2) as totpabr, decimal(16,2) as totrabr, decimal(16,2) as totpmay, decimal(16,2) as totrmay, decimal(16,2) as totpjun, decimal(16,2) as totrjun, decimal(16,2) as totpjul, decimal(16,2) as totrjul, decimal(16,2) as totpago, decimal(16,2) as totrago, decimal(16,2) as totpsep, decimal(16,2) as totrsep, decimal(16,2) as totpoct, decimal(16,2) as totroct, decimal(16,2) as totpnov, decimal(16,2) as totrnov, decimal(16,2) as totpdic, decimal(16,2) as totrdic; define v_noobra integer; define v_div char(2); define v_nomzona char(50); define v_numzona char(2); define v_obra char(500); define v_anio integer; define v_mat char(50); define v_mo char(50); define v_tot char(50); define v_matp char(2); define v_matr char(2); define v_mop char(2); define v_mor char(2); define v_totp char(2); define v_totr char(2); define v_matpene decimal(16,2); define v_matrene decimal(16,2); define v_matpfeb decimal(16,2); define v_matrfeb decimal(16,2); define v_matpmar decimal(16,2); define v_matrmar decimal(16,2); define v_matpabr decimal(16,2); define v_matrabr decimal(16,2); define v_matpmay decimal(16,2); define v_matrmay decimal(16,2); define v_matpjun decimal(16,2); define v_matrjun decimal(16,2); define v_matpjul decimal(16,2); define v_matrjul decimal(16,2); define v_matpago decimal(16,2); define v_matrago decimal(16,2); define v_matpsep decimal(16,2); define v_matrsep decimal(16,2); define v_matpoct decimal(16,2); define v_matroct decimal(16,2); define v_matpnov decimal(16,2); define v_matrnov decimal(16,2); define v_matpdic decimal(16,2); define v_matrdic decimal(16,2); define v_manopene decimal(16,2); define v_manorene decimal(16,2); define v_manopfeb decimal(16,2); define v_manorfeb decimal(16,2); define v_manopmar decimal(16,2); define v_manormar decimal(16,2); define v_manopabr decimal(16,2); define v_manorabr decimal(16,2); define v_manopmay decimal(16,2); define v_manormay decimal(16,2); define v_manopjun decimal(16,2); define v_manorjun decimal(16,2); define v_manopjul decimal(16,2); define v_manorjul decimal(16,2); define v_manopago decimal(16,2); define v_manorago decimal(16,2); define v_manopsep decimal(16,2); define v_manorsep decimal(16,2); define v_manopoct decimal(16,2); define v_manoroct decimal(16,2); define v_manopnov decimal(16,2); define v_manornov decimal(16,2); define v_manopdic decimal(16,2); define v_manordic decimal(16,2); define v_totpene decimal(16,2); define v_totrene decimal(16,2); define v_totpfeb decimal(16,2); define v_totrfeb decimal(16,2); define v_totpmar decimal(16,2); define v_totrmar decimal(16,2); define v_totpabr decimal(16,2); define v_totrabr decimal(16,2); define v_totpmay decimal(16,2); define v_totrmay decimal(16,2); define v_totpjun decimal(16,2); define v_totrjun decimal(16,2); define v_totpjul decimal(16,2); define v_totrjul decimal(16,2); define v_totpago decimal(16,2); define v_totrago decimal(16,2); define v_totpsep decimal(16,2); define v_totrsep decimal(16,2); define v_totpoct decimal(16,2); define v_totroct decimal(16,2); define v_totpnov decimal(16,2); define v_totrnov decimal(16,2); define v_totpdic decimal(16,2); define v_totrdic decimal(16,2); --set debug file to 'd://AvanceObrasCant'; --trace on; foreach select no, nombre, division, anio_obra, zona into v_noobra, v_obra, v_div, v_anio, v_nomzona from obras ORDER BY nombre ASC if v_nomzona='4091' then let v_nomzona='31 - MORELOS'; end if; if v_nomzona='4096' then let v_nomzona='81 - ACAPULCO'; end if; if v_nomzona='4089' then let v_nomzona='11 - CHILPANCINGO'; end if; if v_nomzona='4090' then let v_nomzona='21 - IGUALA'; end if; if v_nomzona='4092' then let v_nomzona='41 - TOLUCA'; end if; if v_nomzona='4095' then let v_nomzona='71 - VALLE DE BRAVO'; end if; if v_nomzona='4093' then let v_nomzona='51 - ALTAMIRANO'; end if; if v_nomzona='4097' then let v_nomzona='91 - ZIHUATANEJO'; end if; ... continuara |
|
#3
|
|||
|
|||
|
...continuacion
select sum(cant*preciounitario) into v_matpene from materialesobra where fechavencimiento like p_anio||'/01/__' and noobra=v_noobra; select sum(cant*preciounitario) into v_matpfeb from materialesobra where fechavencimiento like p_anio||'/02/__' and noobra=v_noobra; select sum(cant) into v_matpmar from materialesobra where fechavencimiento like p_anio||'/03/__' and noobra=v_noobra; select sum(cant) into v_matpabr from materialesobra where fechavencimiento like p_anio||'/04/__' and noobra=v_noobra; select sum(cant) into v_matpmay from materialesobra where fechavencimiento like p_anio||'/05/__' and noobra=v_noobra; select sum(cant) into v_matpjun from materialesobra where fechavencimiento like p_anio||'/06/__' and noobra=v_noobra; select sum(cant) into v_matpjul from materialesobra where fechavencimiento like p_anio||'/07/__' and noobra=v_noobra; select sum(cant) into v_matpago from materialesobra where fechavencimiento like p_anio||'/08/__' and noobra=v_noobra; select sum(cant) into v_matpsep from materialesobra where fechavencimiento like p_anio||'/09/__' and noobra=v_noobra; select sum(cant) into v_matpoct from materialesobra where fechavencimiento like p_anio||'/10/__' and noobra=v_noobra; select sum(cant) into v_matpnov from materialesobra where fechavencimiento like p_anio||'/11/__' and noobra=v_noobra; select sum(cant) into v_matpdic from materialesobra where fechavencimiento like p_anio||'/12/__' and noobra=v_noobra; let v_matrene = 0.0; let v_matrfeb = 0.0; let v_matrmar = 0.0; let v_matrabr = 0.0; let v_matrmay = 0.0; let v_matrjun = 0.0; let v_matrjul = 0.0; let v_matrago = 0.0; let v_matrsep = 0.0; let v_matroct = 0.0; let v_matrnov = 0.0; let v_matrdic = 0.0; select sum(programado*preciounitario) into v_manopene from manoobra_obra where fechavencimiento like p_anio||'/01/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopfeb from manoobra_obra where fechavencimiento like p_anio||'/02/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopmar from manoobra_obra where fechavencimiento like p_anio||'/03/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopabr from manoobra_obra where fechavencimiento like p_anio||'/04/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopmay from manoobra_obra where fechavencimiento like p_anio||'/05/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopjun from manoobra_obra where fechavencimiento like p_anio||'/06/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopjul from manoobra_obra where fechavencimiento like p_anio||'/07/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopago from manoobra_obra where fechavencimiento like p_anio||'/08/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopsep from manoobra_obra where fechavencimiento like p_anio||'/09/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopoct from manoobra_obra where fechavencimiento like p_anio||'/10/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopnov from manoobra_obra where fechavencimiento like p_anio||'/11/__' and noobra=v_noobra; select sum(programado*preciounitario) into v_manopdic from manoobra_obra where fechavencimiento like p_anio||'/12/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manorene from manoobra_obra where fechavencimiento like p_anio||'/01/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manorfeb from manoobra_obra where fechavencimiento like p_anio||'/02/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manormar from manoobra_obra where fechavencimiento like p_anio||'/03/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manorabr from manoobra_obra where fechavencimiento like p_anio||'/04/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manormay from manoobra_obra where fechavencimiento like p_anio||'/05/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manorjun from manoobra_obra where fechavencimiento like p_anio||'/06/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manorjul from manoobra_obra where fechavencimiento like p_anio||'/07/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manorago from manoobra_obra where fechavencimiento like p_anio||'/08/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manorsep from manoobra_obra where fechavencimiento like p_anio||'/09/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manoroct from manoobra_obra where fechavencimiento like p_anio||'/10/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manornov from manoobra_obra where fechavencimiento like p_anio||'/11/__' and noobra=v_noobra; select sum(real*preciounitario) into v_manordic from manoobra_obra where fechavencimiento like p_anio||'/12/__' and noobra=v_noobra; let v_totpene=v_matpene+v_manopene; let v_totrene=v_matrene+v_manorene; let v_totpfeb=v_matpfeb+v_manopfeb; let v_totrfeb=v_matrfeb+v_manorfeb; let v_totpmar=v_matpmar+v_manopmar; let v_totrmar=v_matrmar+v_manormar; let v_totpabr=v_matpabr+v_manopabr; let v_totrabr=v_matrabr+v_manorabr; let v_totpmay=v_matpmay+v_manopmay; let v_totrmay=v_matrmay+v_manormay; let v_totpjun=v_matpjun+v_manopjun; let v_totrjun=v_matrjun+v_manorjun; let v_totpjul=v_matpjul+v_manopjul; let v_totrjul=v_matrjul+v_manorjul; let v_totpago=v_matpago+v_manopago; let v_totrago=v_matrago+v_manorago; let v_totpsep=v_matpsep+v_manopsep; let v_totrsep=v_matrsep+v_manorsep; let v_totpoct=v_matpoct+v_manopoct; let v_totroct=v_matroct+v_manoroct; let v_totpnov=v_matpnov+v_manopnov; let v_totrnov=v_matrnov+v_manornov; let v_totpdic=v_matpdic+v_manopdic; let v_totrdic=v_matrdic+v_manordic; let v_mat='Materiales'; let v_mo='Mano de obra'; let v_tot='Totales'; let v_matp='P'; let v_matr='R'; let v_mop='P'; let v_mor='R'; let v_totp='P'; let v_totr='R'; return v_nomzona, v_obra, v_anio, v_mat, v_mo, v_tot, v_matp, v_matr, v_mop, v_mor, v_totp, v_totr, v_matpene, v_matrene, v_matpfeb, v_matrfeb, v_matpmar, v_matrmar, v_matpabr, v_matrabr, v_matpmay, v_matrmay, v_matpjun, v_matrjun, v_matpjul, v_matrjul, v_matpago, v_matrago, v_matpsep, v_matrsep, v_matpoct, v_matroct, v_matpnov, v_matrnov, v_matpdic, v_matrdic, v_manopene, v_manorene, v_manopfeb, v_manorfeb, v_manopmar, v_manormar, v_manopabr, v_manorabr, v_manopmay, v_manormay, v_manopjun, v_manorjun, v_manopjul, v_manorjul, v_manopago, v_manorago, v_manopsep, v_manorsep, v_manopoct, v_manoroct, v_manopnov, v_manornov, v_manopdic, v_manordic, v_totpene, v_totrene, v_totpfeb, v_totrfeb, v_totpmar, v_totrmar, v_totpabr, v_totrabr, v_totpmay, v_totrmay, v_totpjun, v_totrjun, v_totpjul, v_totrjul, v_totpago, v_totrago, v_totpsep, v_totrsep, v_totpoct, v_totroct, v_totpnov, v_totrnov, v_totpdic, v_totrdic with resume; end foreach; END PROCEDURE; |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Funcion de tiempo | pedromanuel | JAVA | 7 | 29-11-2006 00:00:58 |
| Utileria para Informix | cacuna | Varios | 2 | 19-08-2006 01:21:59 |
| como hago para minimizar un Form en tiempo de ejecucion y se coloque en la barra de t | Shidalis | Varios | 3 | 20-10-2005 22:22:02 |
| Creacion de DSN con ODBC para MySql en tiempo de ejecucion | meosre | MySQL | 1 | 28-09-2005 22:00:01 |
| ¿Cómo cargar un Glyph para un botón en tiempo de ejecución? | Feñiz | Gráficos | 2 | 09-12-2003 12:38:53 |
|