Advertisement
psi_mmobile

Untitled

Sep 29th, 2021
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 4.69 KB | None | 0 0
  1. SELECT
  2.     attachdoc.attach_doc_id,
  3.     attachdoc.content_type_id,
  4.     attachdoc.creation_date,
  5.     attachdoc.description,
  6.     attachdoc.document_date,
  7.     attachdoc.document_type_id,
  8.     attachdoc.expiry_date,
  9.     attachdoc.file_path,
  10.     attachdoc.lm_comment,
  11.     attachdoc.lm_date,
  12.     attachdoc.lm_name,
  13.     attachdoc.name,
  14.     attachdoc.order_num,
  15.     attachdoc.person_id,
  16.     attachdoc.vehicle_id,
  17.     attachdoc.gui_user_id,
  18.     attachdoc.generic_event_id,
  19.     attachdoc.short_name,
  20.     attachdoc.poi_id,
  21.     attachdoc.object_id,
  22.     person.person_id                                     AS person_id1,
  23.     ( person.last_name
  24.       || ' '
  25.       || person.first_name )                               AS view_attr,
  26.     p_wbs.getwbsname(attachdoc.wbs_id, attachdoc.poi_id) AS view_attr,
  27.     ( guiusers.last_name
  28.       || ' '
  29.       || guiusers.first_name )                             AS view_attr,
  30.     ( vehicle.company_nr
  31.       || ' '
  32.       || vehicle.numberplate )                             AS view_attr,
  33.     NVL2(object.vehicle_id, '['
  34.                             || object.company_nr
  35.                             || '].['
  36.                             || object.numberplate
  37.                             || ']', NULL)                                        AS view_attr,
  38.     ( '['
  39.       || p_wbs.getwbsname(attachdoc.wbs_id, attachdoc.poi_id)
  40.       || '].['
  41.       || attachdoc.name
  42.       || '].['
  43.       || person.last_name
  44.       || ' '
  45.       || '].['
  46.       || person.first_name
  47.       || ' '
  48.       || person.last_name
  49.       || '].['
  50.       || vehicle.numberplate
  51.       || '].['
  52.       || vovehiclecategory.name
  53.       || '].['
  54.       || object.numberplate
  55.       || ']' )                                             AS view_attr,
  56.     attachdoc.wbs_id,
  57.     attachdoc.ref_number,
  58.     (
  59.         SELECT
  60.             numberplate
  61.         FROM
  62.             vehicle v
  63.         WHERE
  64.             v.vehicle_id = attachdoc.vehicle_id
  65.     )                                                    AS view_attr,
  66.     (
  67.         SELECT
  68.             company_nr
  69.         FROM
  70.             vehicle v
  71.         WHERE
  72.             v.vehicle_id = attachdoc.vehicle_id
  73.     )                                                    AS view_attr,
  74.     documenttype.document_type_category_id,
  75.     documenttype.document_type_id                        AS document_type_id1
  76. FROM
  77.     of_owner.attach_doc    attachdoc,
  78.     v_updatable_person     person,
  79.     gui_users              guiusers,
  80.     vehicle                vehicle,
  81.     vehicle                object,
  82.     vo_vehicle_category    vovehiclecategory,
  83.     of_owner.document_type documenttype
  84. WHERE
  85.     ( ( attachdoc.person_id = person.person_id (+)
  86.         AND attachdoc.document_type_id = documenttype.document_type_id (+)
  87.         AND attachdoc.gui_user_id = guiusers.gui_user_id
  88.         AND attachdoc.vehicle_id = vehicle.vehicle_id (+)
  89.         AND attachdoc.object_id = object.vehicle_id (+)
  90.         AND object.vo_vehicle_category_id = vovehiclecategory.vo_vehicle_category_id (+)
  91.         AND ( attachdoc.person_id IN (
  92.         SELECT
  93.             person_id
  94.         FROM
  95.             gu_person
  96.         WHERE
  97.             gui_user_id = 118705
  98.     )
  99.               OR attachdoc.vehicle_id IN (
  100.         SELECT
  101.             vehicle_id
  102.         FROM
  103.             gu_vehicle
  104.         WHERE
  105.             gui_user_id = 118705
  106.     )
  107.               OR attachdoc.object_id IN (
  108.         SELECT
  109.             vehicle_id
  110.         FROM
  111.             gu_vehicle
  112.         WHERE
  113.             gui_user_id = 118705
  114.     )
  115.               OR attachdoc.poi_id IN (
  116.         SELECT
  117.             poi_id
  118.         FROM
  119.             v_gui_user_oc_poi
  120.         WHERE
  121.             gui_user_id = 118705
  122.     )
  123.               OR attachdoc.wbs_id IN (
  124.         SELECT
  125.             wbs_id
  126.         FROM
  127.             wbs
  128.         WHERE
  129.             vehicle_owner_id IN (
  130.                 SELECT DISTINCT
  131.                     vehicle_owner_id
  132.                 FROM
  133.                     gu_vehicle_owner
  134.                 WHERE
  135.                     gui_user_id = 118705
  136.             )
  137.     )
  138.               OR attachdoc.gui_user_id = 118705 )
  139.         AND ( NULL IS NULL
  140.               OR attachdoc.person_id = NULL )
  141.         AND ( NULL IS NULL
  142.               OR attachdoc.vehicle_id = NULL )
  143.         AND ( NULL IS NULL
  144.               OR attachdoc.poi_id = NULL )
  145.         AND ( NULL IS NULL
  146.               OR attachdoc.object_id = NULL )
  147.         AND ( NULL IS NULL
  148.               OR attachdoc.wbs_id = NULL ) )
  149. AND attachdoc.document_type_id = 1007  --extra where clause from ContextBean
  150. AND attachdoc.person_id = 295245 --extra where clause from ContextBean
  151. --      AND attachdoc.attach_doc_id = ? --missing parameter at index 17
  152.       )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement