lunes, 19 de mayo de 2014

Query para obtener las organizaciones de Inventory

Query para obtener las organizaciones del modulo de inventarios en base al perfil ORG_ID

select 
mp.organization_code codigo_organizacion,
hou.name nombre_organizacion,
hou.address_line_1 || case when hou.address_line_2 is not null then ' - ' else '' end || hou.address_line_2 || case when hou.address_line_3 is not null then ' - ' else '' end ||hou.address_line_3 || case when hou.region_1 is not null then ' - ' else '' end ||hou.region_1 || case when hou.region_2 is not null then ' - ' else '' end ||hou.region_2 || case when hou.region_3 is not null then ' - ' else '' end || hou.region_3  direccion_organizacion

from org_organization_definitions ood,
     mtl_parameters               mp,
     hr_organization_units_v      hou
 where ood.organization_id = mp.organization_id
   and hou.organization_id = mp.organization_id
   and ood.OPERATING_UNIT = &org_id --perfil org_id

No hay comentarios:

Publicar un comentario