0
親愛的朋友們,我把這些語句存儲在一個表中,我需要執行它們來接收結果。如何執行PL/SQL表語句
DECODE (to_char((SELECT s1.streettypename FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||''|| to_char((SELECT s0.streetname FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||''|| to_char(NRO_VIA) ||''|| to_char(NRO_PUERTA),'', 'No Disponible', to_char((SELECT s1.streettypename FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||' '|| to_char((SELECT s0.streetname FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||' '|| to_char(NRO_VIA) ||' '|| to_char(NRO_PUERTA))',DECODE (to_char((SELECT s1.streettypename FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||''|| to_char((SELECT s0.streetname FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||''|| to_char(NRO_VIA) ||''|| to_char(NRO_PUERTA),'', 'No Disponible', to_char((SELECT s1.streettypename FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||' '|| to_char((SELECT s0.streetname FROM autodesk.smstreets s0, autodesk.smstreettypes s1 where s0.streettypeid = s1.streettypeid(+) AND s0.streetantiq=0 AND s0.streetid=COD_VIA)) ||' '|| to_char(NRO_VIA) ||' '|| to_char(NRO_PUERTA)) FROM cliente WHERE NRO_CLIENTE='104631'
DECODE (observaciones, NULL, 'No Disponible', '', 'No Disponible', observaciones)',DECODE (observaciones, NULL, 'No Disponible', '', 'No Disponible', observaciones) FROM cliente WHERE NRO_CLIENTE='104631'
to_char((SELECT areaname FROM autodesk.amareas a0 WHERE a0.areaid=COD_DISTRITO))',to_char((SELECT areaname FROM autodesk.amareas a0 WHERE a0.areaid=COD_DISTRITO)) FROM cliente WHERE NRO_CLIENTE='104631'
to_char((SELECT areaname FROM autodesk.amareas a0 WHERE a0.areaid=COD_PROVINCIA))',to_char((SELECT areaname FROM autodesk.amareas a0 WHERE a0.areaid=COD_PROVINCIA)) FROM cliente WHERE NRO_CLIENTE='104631'
to_char(correlativo)',to_char(correlativo) FROM cliente WHERE NRO_CLIENTE='104631'
sed',sed FROM cliente WHERE NRO_CLIENTE='104631'
to_char(telefono)',to_char(telefono) FROM s_v_cliente WHERE NRO_CLIENTE='104631'
to_char(numero_medidor)',to_char(numero_medidor) FROM tps.s_v_medid, cliente c WHERE NRO_CLIENTE='104631'
to_char(d.Consumo)',to_char(d.Consumo) FROM cliente c,(SELECT Id_Cuenta, Consumo FROM (SELECT a.Id_Cuenta, b.ENERGIA_FP Consumo FROM s_NUC_SERVICIO a, s_his_consumo b WHERE UPPER(a.tipo_Servicio) = 'ELECTRICO' AND a.id_servicio=b.id_servicio AND a.Id_Cuenta= %ID_ELEMENTO% ORDER BY fecha_lectura DESC) WHERE ROWNUM <=1) d WHERE NRO_CLIENTE='104631'
to_char(d.Potencia)',to_char(d.Potencia) FROM cliente c,(SELECT Id_Cuenta, Potencia FROM (SELECT a.Id_Cuenta, (SELECT potencia_cont_fp FROM s_v_cliente WHERE numero_cliente = a.Id_Cuenta) Potencia FROM s_NUC_SERVICIO a, s_his_consumo b WHERE UPPER(a.tipo_Servicio) = 'ELECTRICO' AND a.id_servicio = b.id_servicio AND a.Id_Cuenta = %ID_ELEMENTO% ORDER BY fecha_lectura DESC) WHERE ROWNUM <=1) d WHERE NRO_CLIENTE='104631'
fase',fase FROM cliente WHERE NRO_CLIENTE='104631'
to_char(NRO_CLIENTE)',to_char(NRO_CLIENTE) FROM cliente WHERE NRO_CLIENTE='104631'
nombre',nombre FROM cliente WHERE NRO_CLIENTE='104631'
to_char(pcr)',to_char(pcr) FROM cliente WHERE NRO_CLIENTE='104631'
TO_CHAR(DECODE(TIPO,1,'NORMAL',2,'MAXIMETRO',4,'PIMT',7,'HH.UU. Y PP.JJ',8,'ALUMBRADO PUBLICO','No Disponible'))',TO_CHAR(DECODE(TIPO,1,'NORMAL',2,'MAXIMETRO',4,'PIMT',7,'HH.UU. Y PP.JJ',8,'ALUMBRADO PUBLICO','No Disponible')) FROM cliente WHERE NRO_CLIENTE='104631'
TO_CHAR(DECODE(estado,0,'ACTIVO',1,'ELIMINADO',2,'RETIRADO',3,'NUEVO',4,'PROCESO DE RETIRO','No Disponible'))',TO_CHAR(DECODE(estado,0,'ACTIVO',1,'ELIMINADO',2,'RETIRADO',3,'NUEVO',4,'PROCESO DE RETIRO','No Disponible')) FROM cliente WHERE NRO_CLIENTE='104631'
cadena',cadena FROM cliente WHERE NRO_CLIENTE='104631'
to_char(sector)',to_char(sector) FROM cliente WHERE NRO_CLIENTE='104631'
to_char(zona)',to_char(zona) FROM cliente WHERE NRO_CLIENTE='104631'
歡迎來到Stack Overflow,@miMescua。要獲得最佳答案,您將有助於編輯您的問題以提供更多信息。具體而言,您希望得到的結果,輸入數據的樣本,以及您當前的嘗試未正確執行的方式。請查看:https://stackoverflow.com/help/how-to-ask – Degan