nilin
Programmer
- Aug 14, 2003
- 26
Hi, I need to convert following Oracle SQL to Informix SQL, Please help since i am facing problems with Outer join
Thanks in advance
Sandeep
Oracle SQL:
=====+++++
SELECT DISTINCT
PVC.PVC_ID,PVC.RSWITCH,PVC.RSLOT,PVC.RPORT,PVC.PVC_RDLCI,
PVC.PVC_RCONTRCIR,PVC.PVC_rVCI,PVC.PVC_rVPI,PVC.LSWITCH,PVC.LSLOT,
PVC.LPORT,PVC.PVC_LDLCI,PVC.PVC_LCONTRCIR,PVC.PVC_lVPI,PVC.PVC_lVCI,
VPNA.VPN_NAME AS AVPN_NAME,VPNZ.VPN_NAME ZVPN_NAME,IPFRA.VPN_ID AS AVPN_ID ,
IPFRZ.VPN_ID AS ZAVPN_ID,SITEA.SITE_ID AS ASITE_ID ,SITEA.FULL_PORT_SPEED AS AFULL_PORT_SPEED,
SITEA.GRC AS AGRC,SITEA.CLLI AS ACLLI, SITEA.protocol Protocol_A, SITEZ.SITE_ID AS ZSITE_ID ,SITEZ.FULL_PORT_SPEED AS ZFULL_PORT_SPEED,SITEZ.GRC AS ZGRC,SITEZ.CLLI AS ZCLLIL, SITEZ.protocol Protocol_Z, CUSTOMERA.CUST_NAME AS ACUST_NAME ,CUSTOMERA.CUST_MCN AS ACUST_MCN,CUSTOMERA.CUST_ID AS ACUST_ID,CUSTOMERZ.CUST_NAME AS ZCUST_NAME ,
CUSTOMERZ.CUST_MCN AS ZCUST_MCN ,
CUSTOMERZ.CUST_ID AS ZCUST_ID,CUST_ACCESSA.ACC_CKT AACC_CKT,CUST_ACCESSz.ACC_CKT zACC_CKT,
PREMISEA.LOC_ID ALOC_ID, PREMISEA.PREM_ADDRESS APREM_ADDRESS,PREMISEA.PREM_CITY APREM_CITY,PREMISEA.PREM_STATE APREM_STATE,
PREMISEA.PREM_COUNTRY APREM_COUNTRY,PREMISEZ.LOC_ID ZLOC_ID, PREMISEZ.PREM_ADDRESS ZPREM_ADDRESS,
PREMISEZ.PREM_CITY ZPREM_CITY,
PREMISEZ.PREM_STATE ZPREM_STATE,PREMISEZ.PREM_COUNTRY ZPREM_COUNTRY,
VPNA.CUST_ID VPNACUSTID, VPNZ.CUST_ID VPNZCUSTID,
IPFRA.CPE_IP_ADDRESS ACPEIPADDRESS, IPFRZ.CPE_IP_ADDRESS ZCPEIPADDRESS
FROM
PVC PVC ,
IPFR IPFRA,
IPFR IPFRZ,
VPN VPNA,
VPN VPNZ,
CUSTOMER CUSTOMERA,
CUSTOMER CUSTOMERZ,
CUST_ACCESS CUST_ACCESSA,
CUST_ACCESS CUST_ACCESSZ,
SITE SITEA,
SITE SITEZ,
PREMISE PREMISEA,
PREMISE PREMISEZ,
PORT_ASGMT PORT_ASGMT,
EQUIPMENT EQUIPMENT
WHERE
SITEA.site_id = PORT_ASGMT.site_id (+)
And PORT_ASGMT.site_id = CUST_ACCESSA.site_id(+)
And PORT_ASGMT.equip_id = EQUIPMENT.equip_id (+)
And SITEZ.prem_loc_id = PREMISEZ.loc_id (+)
AND SITEA.prem_loc_id = PREMISEA.loc_id
And SITEZ.site_id = PVC.pvc_rsite_id (+)
AND SITEA.site_id = PVC.pvc_lsite_id
And PVC.pvc_id = IPFRA.pvc_id (+)
And PVC.pvc_id = IPFRZ.pvc_id (+)
And IPFRA.vpn_id = VPNA.vpn_id
And IPFRZ.vpn_id = VPNZ.vpn_id
And PVC.pvc_rcust_id = customerZ.cust_id
And PVC.pvc_lcust_id = customerA.cust_id
And CUST_ACCESSZ.cust_id = CUSTOMERZ.cust_id(+)
And CUST_ACCESSA.cust_id = CUSTOMERA.cust_id (+)
And upper(EQUIPMENT.equip_name) = 'BRHMAL01 '
and PORT_ASGMT.port = '39'
and PORT_ASGMT.slot = '3'
Thanks in advance
Sandeep
Oracle SQL:
=====+++++
SELECT DISTINCT
PVC.PVC_ID,PVC.RSWITCH,PVC.RSLOT,PVC.RPORT,PVC.PVC_RDLCI,
PVC.PVC_RCONTRCIR,PVC.PVC_rVCI,PVC.PVC_rVPI,PVC.LSWITCH,PVC.LSLOT,
PVC.LPORT,PVC.PVC_LDLCI,PVC.PVC_LCONTRCIR,PVC.PVC_lVPI,PVC.PVC_lVCI,
VPNA.VPN_NAME AS AVPN_NAME,VPNZ.VPN_NAME ZVPN_NAME,IPFRA.VPN_ID AS AVPN_ID ,
IPFRZ.VPN_ID AS ZAVPN_ID,SITEA.SITE_ID AS ASITE_ID ,SITEA.FULL_PORT_SPEED AS AFULL_PORT_SPEED,
SITEA.GRC AS AGRC,SITEA.CLLI AS ACLLI, SITEA.protocol Protocol_A, SITEZ.SITE_ID AS ZSITE_ID ,SITEZ.FULL_PORT_SPEED AS ZFULL_PORT_SPEED,SITEZ.GRC AS ZGRC,SITEZ.CLLI AS ZCLLIL, SITEZ.protocol Protocol_Z, CUSTOMERA.CUST_NAME AS ACUST_NAME ,CUSTOMERA.CUST_MCN AS ACUST_MCN,CUSTOMERA.CUST_ID AS ACUST_ID,CUSTOMERZ.CUST_NAME AS ZCUST_NAME ,
CUSTOMERZ.CUST_MCN AS ZCUST_MCN ,
CUSTOMERZ.CUST_ID AS ZCUST_ID,CUST_ACCESSA.ACC_CKT AACC_CKT,CUST_ACCESSz.ACC_CKT zACC_CKT,
PREMISEA.LOC_ID ALOC_ID, PREMISEA.PREM_ADDRESS APREM_ADDRESS,PREMISEA.PREM_CITY APREM_CITY,PREMISEA.PREM_STATE APREM_STATE,
PREMISEA.PREM_COUNTRY APREM_COUNTRY,PREMISEZ.LOC_ID ZLOC_ID, PREMISEZ.PREM_ADDRESS ZPREM_ADDRESS,
PREMISEZ.PREM_CITY ZPREM_CITY,
PREMISEZ.PREM_STATE ZPREM_STATE,PREMISEZ.PREM_COUNTRY ZPREM_COUNTRY,
VPNA.CUST_ID VPNACUSTID, VPNZ.CUST_ID VPNZCUSTID,
IPFRA.CPE_IP_ADDRESS ACPEIPADDRESS, IPFRZ.CPE_IP_ADDRESS ZCPEIPADDRESS
FROM
PVC PVC ,
IPFR IPFRA,
IPFR IPFRZ,
VPN VPNA,
VPN VPNZ,
CUSTOMER CUSTOMERA,
CUSTOMER CUSTOMERZ,
CUST_ACCESS CUST_ACCESSA,
CUST_ACCESS CUST_ACCESSZ,
SITE SITEA,
SITE SITEZ,
PREMISE PREMISEA,
PREMISE PREMISEZ,
PORT_ASGMT PORT_ASGMT,
EQUIPMENT EQUIPMENT
WHERE
SITEA.site_id = PORT_ASGMT.site_id (+)
And PORT_ASGMT.site_id = CUST_ACCESSA.site_id(+)
And PORT_ASGMT.equip_id = EQUIPMENT.equip_id (+)
And SITEZ.prem_loc_id = PREMISEZ.loc_id (+)
AND SITEA.prem_loc_id = PREMISEA.loc_id
And SITEZ.site_id = PVC.pvc_rsite_id (+)
AND SITEA.site_id = PVC.pvc_lsite_id
And PVC.pvc_id = IPFRA.pvc_id (+)
And PVC.pvc_id = IPFRZ.pvc_id (+)
And IPFRA.vpn_id = VPNA.vpn_id
And IPFRZ.vpn_id = VPNZ.vpn_id
And PVC.pvc_rcust_id = customerZ.cust_id
And PVC.pvc_lcust_id = customerA.cust_id
And CUST_ACCESSZ.cust_id = CUSTOMERZ.cust_id(+)
And CUST_ACCESSA.cust_id = CUSTOMERA.cust_id (+)
And upper(EQUIPMENT.equip_name) = 'BRHMAL01 '
and PORT_ASGMT.port = '39'
and PORT_ASGMT.slot = '3'