Advertisement
psi_mmobile

Untitled

Jun 16th, 2021
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.42 KB | None | 0 0
  1. create or replace TRIGGER "OF_OWNER"."DEBUG_AFTER_VEHICLE_UPDATE"
  2. AFTER UPDATE
  3. ON VEHICLE
  4. FOR EACH ROW
  5. Begin
  6. if ( upper (nvl (:new.COMPANY_NR, 1)) <> upper (nvl (:old.COMPANY_NR, 1)) or upper (nvl (:new.NUMBERPLATE, 1)) <> upper (nvl(:old.NUMBERPLATE, 1))) THEN
  7. insert into DEBUG_VEHICLE (
  8. VEHICLE_ID,
  9. NEW_VEHICLE_ID,
  10. VEHICLE_CATEGORY_ID,
  11. REMOTE_UNIT_ID,
  12. NEW_REMOTE_UNIT_ID,
  13. VEHICLE_OWNER_ID,
  14. NEW_VEHICLE_OWNER_ID,
  15. PERSON_ID,
  16. NUMBERPLATE,
  17. NEW_NUMBERPLATE,
  18. COMPANY_NR,
  19. NEW_COMPANY_NR,
  20. COLOR,
  21. BRAND,
  22. MODEL,
  23. DOOR,
  24. FUEL,
  25. TRANSMISSION,
  26. ENGINESIZE,
  27. LAST_SERVICE_DATE,
  28. LAST_SERVICE_KM,
  29. RU_INSTALL_KM,
  30. RU_INSTALL_DATE,
  31. ACTUAL_TRACKING_MODE,
  32. LM_DATE,
  33. NEW_LM_DATE,
  34. LM_NAME,
  35. NEW_LM_NAME,
  36. LM_COMMENT,
  37. CHASSIS_NR,
  38. LICENCE_PLATE_NR,
  39. VO_VEHICLE_CATEGORY_ID,
  40. NEW_VO_VEHICLE_CATEGORY_ID,
  41. LAST_VEHICLE_DATA_ID,
  42. LAST_VEHICLE_POSITION_ID,
  43. CONTRACT_ID,
  44. LAST_BUT_ONE_VEHICLE_DATA_ID,
  45. COST_PER_MONTH,
  46. COST_PER_KM,
  47. FUEL_PER_100KM,
  48. FUEL_TYPE_ID,
  49. FUEL_TANK_CAPACITY,
  50. SERVICE_PERIOD_KM,
  51. SERVICE_PERIOD_MONTH,
  52. TECHNICAL_CONTROL_PERIOD_MONTH,
  53. TECHNICAL_CONTROL_VALIDITY,
  54. LICENCE_PLATE_START_DATE,
  55. IN_SERVICE_DATE,
  56. OUT_SERVICE_DATE,
  57. MAX_NBR_PERSONS,
  58. RU_INSTALL_HR,
  59. LAST_SERVICE_HR,
  60. SERVICE_PERIOD_HR,
  61. VEHICLE_LEGAL_CATEGORY_ID,
  62. CO2_EMISSION_RATE,
  63. PRIVATE_USE_ALLOWED,
  64. PRIVATE_USE_ALLOWED_PERSON_ID,
  65. OLD_VO_VEHICLE_CATEGORY_ID,
  66. LAST_USERS_CAT,
  67. LAST_USERS,
  68. RU_LM_RG_ADDRESS,
  69. RU_LM_DATE,
  70. RU_INSTALL_COMMENT,
  71. LAST_BADGE_VEHICLE_DATA_ID,
  72. PND_STATUS_ID,
  73. ERP_CATEGORY,
  74. ERP_DEFAULT_DRIVER,
  75. ERP_COMPANY_CODE,
  76. BADGE_READER_MODEL,
  77. CO2_CATEGORY,
  78. CO2_CATEGORY_DESCRIPTION,
  79. COST_PER_DAY,
  80. COST_PER_HR,
  81. DETAILED_DESCRIPTION,
  82. ERP_ARTICLE_DESCRIPTION,
  83. ERP_ARTICLE_NUMBER,
  84. ERP_COST_CENTER,
  85. ERP_DRIVER_COMPANY_CODE,
  86. ERP_EQUIPMENT_NR,
  87. ERP_EQUIPMENT_TYPE,
  88. ERP_FLEET_EQUIPMENT_NR,
  89. ERP_FLEET_STATUS,
  90. ERP_LOCATION,
  91. ERP_PERIOD_ORDER,
  92. ERP_SERIAL_NUMBER,
  93. ERP_STORE,
  94. ERP_SYSTEM_STATUS,
  95. ERP_USAGE,
  96. ERP_WBS_DESCRIPTION,
  97. ERP_WBS_POSITION,
  98. FMS_CABLE_MODEL,
  99. FUEL_TANK_CARD_NR,
  100. IS_ON_CALL,
  101. IS_ON_CALL_CUSTOMER,
  102. IS_ON_CALL_FROM_DATE,
  103. IS_ON_CALL_TO_DATE,
  104. IS_TEMPORARY_CAR,
  105. LEASING_CODE,
  106. LEASING_COMPANY,
  107. MAINTENANCE_PLAN_CODE,
  108. MOTOR_POWER,
  109. NIGHT_USE_ALLOWED,
  110. NUMBERPLATE_DATE,
  111. OTHER_EQUIPEMENTS,
  112. OTHER_EQUIPMENTS,
  113. PLANNED_END_OF_CONTRACT,
  114. PLANNED_KM_PER_YEAR,
  115. PLANNED_START_OF_CONTRACT,
  116. PND_INSTALL_TYPE,
  117. PND_LAST_DELIVERY_DATE,
  118. PND_MODEL,
  119. PND_SERIAL_NR,
  120. PRIVATE_USE_ALLOWED_FROM_DATE,
  121. PRIVATE_USE_ALLOWED_TEMP,
  122. PRIVATE_USE_ALLOWED_TO_DATE,
  123. STATUS_DESCRIPTION,
  124. TECHNICAL_CONTROL_DATE,
  125. VEHICLE_STATUS_ID,
  126. VEH_FCT,
  127. WARANTY_EXPIRATION_DATE,
  128. DO_NOT_INVOICE_IF_NO_DATA,
  129. VEHICLE_SPEED_TYPE_ID,
  130. OBU,
  131. COMPUTE_VEHICLE_ACTIVITY,
  132. VEHICLE_ECO_PROFILE_ID,
  133. LAST_CONTAINER_VEHICLE_ID,
  134. DEFAULT_CONTAINER_VEHICLE_ID,
  135. ACT_INST_TYPE,
  136. REQ_INST_TYPE,
  137. USE_DRIVER_BADGE_EVENT,
  138. ERP_ARTICLE_DESC_FR,
  139. ERP_ARTICLE_DESC_UK,
  140. ERP_INTERNAL_ORDER_NUM,
  141. TYPE,
  142. MTM,
  143. MTM_SLEEP,
  144. SINGLE_WEIGHT,
  145. MAX_CHARGE,
  146. EURONORM,
  147. TACHOGRAPH,
  148. TACHOGRAPH_TYPE,
  149. PERIODIC_MAINTENANCE_PTO_HR,
  150. BADGE_MEANS_WORK_TIME,
  151. AVG_DAY_HR,
  152. AVG_DAY_KM,
  153. LAST_EQUIPMENT_STORE_PLACE_ID,
  154. GRAPHICAL_SYMBOL_ID,
  155. VO_OP_STATUS_ID,
  156. REAL_OWNER_NAME,
  157. REAL_OWNER_SHORT_NAME,
  158. VO_CLASS_TREE_ID,
  159. LAST_RU_TECHNICAL_STATUS_ID,
  160. IS_CLONE_OF_VEHICLE_ID,
  161. LAST_INVENTORY_DATE,
  162. LAST_INVENTORY_BOX_CHECKED
  163. ) VALUES (
  164. :old.VEHICLE_ID,
  165. :new.VEHICLE_ID,
  166. :old.VEHICLE_CATEGORY_ID,
  167. :old.REMOTE_UNIT_ID,
  168. :new.REMOTE_UNIT_ID,
  169. :old.VEHICLE_OWNER_ID,
  170. :new.VEHICLE_OWNER_ID,
  171. :old.PERSON_ID,
  172. :old.NUMBERPLATE,
  173. :new.NUMBERPLATE,
  174. :old.COMPANY_NR,
  175. :new.COMPANY_NR,
  176. :old.COLOR,
  177. :old.BRAND,
  178. :old.MODEL,
  179. :old.DOOR,
  180. :old.FUEL,
  181. :old.TRANSMISSION,
  182. :old.ENGINESIZE,
  183. :old.LAST_SERVICE_DATE,
  184. :old.LAST_SERVICE_KM,
  185. :old.RU_INSTALL_KM,
  186. :old.RU_INSTALL_DATE,
  187. :old.ACTUAL_TRACKING_MODE,
  188. :old.LM_DATE,
  189. :new.LM_DATE,
  190. :old.LM_NAME,
  191. :new.LM_NAME,
  192. :old.LM_COMMENT,
  193. :old.CHASSIS_NR,
  194. :old.LICENCE_PLATE_NR,
  195. :old.VO_VEHICLE_CATEGORY_ID,
  196. :new.VO_VEHICLE_CATEGORY_ID,
  197. :old.LAST_VEHICLE_DATA_ID,
  198. :old.LAST_VEHICLE_POSITION_ID,
  199. :old.CONTRACT_ID,
  200. :old.LAST_BUT_ONE_VEHICLE_DATA_ID,
  201. :old.COST_PER_MONTH,
  202. :old.COST_PER_KM,
  203. :old.FUEL_PER_100KM,
  204. :old.FUEL_TYPE_ID,
  205. :old.FUEL_TANK_CAPACITY,
  206. :old.SERVICE_PERIOD_KM,
  207. :old.SERVICE_PERIOD_MONTH,
  208. :old.TECHNICAL_CONTROL_PERIOD_MONTH,
  209. :old.TECHNICAL_CONTROL_VALIDITY,
  210. :old.LICENCE_PLATE_START_DATE,
  211. :old.IN_SERVICE_DATE,
  212. :old.OUT_SERVICE_DATE,
  213. :old.MAX_NBR_PERSONS,
  214. :old.RU_INSTALL_HR,
  215. :old.LAST_SERVICE_HR,
  216. :old.SERVICE_PERIOD_HR,
  217. :old.VEHICLE_LEGAL_CATEGORY_ID,
  218. :old.CO2_EMISSION_RATE,
  219. :old.PRIVATE_USE_ALLOWED,
  220. :old.PRIVATE_USE_ALLOWED_PERSON_ID,
  221. :old.OLD_VO_VEHICLE_CATEGORY_ID,
  222. :old.LAST_USERS_CAT,
  223. :old.LAST_USERS,
  224. :old.RU_LM_RG_ADDRESS,
  225. :old.RU_LM_DATE,
  226. :old.RU_INSTALL_COMMENT,
  227. :old.LAST_BADGE_VEHICLE_DATA_ID,
  228. :old.PND_STATUS_ID,
  229. :old.ERP_CATEGORY,
  230. :old.ERP_DEFAULT_DRIVER,
  231. :old.ERP_COMPANY_CODE,
  232. :old.BADGE_READER_MODEL,
  233. :old.CO2_CATEGORY,
  234. :old.CO2_CATEGORY_DESCRIPTION,
  235. :old.COST_PER_DAY,
  236. :old.COST_PER_HR,
  237. :old.DETAILED_DESCRIPTION,
  238. :old.ERP_ARTICLE_DESCRIPTION,
  239. :old.ERP_ARTICLE_NUMBER,
  240. :old.ERP_COST_CENTER,
  241. :old.ERP_DRIVER_COMPANY_CODE,
  242. :old.ERP_EQUIPMENT_NR,
  243. :old.ERP_EQUIPMENT_TYPE,
  244. :old.ERP_FLEET_EQUIPMENT_NR,
  245. :old.ERP_FLEET_STATUS,
  246. :old.ERP_LOCATION,
  247. :old.ERP_PERIOD_ORDER,
  248. :old.ERP_SERIAL_NUMBER,
  249. :old.ERP_STORE,
  250. :old.ERP_SYSTEM_STATUS,
  251. :old.ERP_USAGE,
  252. :old.ERP_WBS_DESCRIPTION,
  253. :old.ERP_WBS_POSITION,
  254. :old.FMS_CABLE_MODEL,
  255. :old.FUEL_TANK_CARD_NR,
  256. :old.IS_ON_CALL,
  257. :old.IS_ON_CALL_CUSTOMER,
  258. :old.IS_ON_CALL_FROM_DATE,
  259. :old.IS_ON_CALL_TO_DATE,
  260. :old.IS_TEMPORARY_CAR,
  261. :old.LEASING_CODE,
  262. :old.LEASING_COMPANY,
  263. :old.MAINTENANCE_PLAN_CODE,
  264. :old.MOTOR_POWER,
  265. :old.NIGHT_USE_ALLOWED,
  266. :old.NUMBERPLATE_DATE,
  267. :old.OTHER_EQUIPEMENTS,
  268. :old.OTHER_EQUIPMENTS,
  269. :old.PLANNED_END_OF_CONTRACT,
  270. :old.PLANNED_KM_PER_YEAR,
  271. :old.PLANNED_START_OF_CONTRACT,
  272. :old.PND_INSTALL_TYPE,
  273. :old.PND_LAST_DELIVERY_DATE,
  274. :old.PND_MODEL,
  275. :old.PND_SERIAL_NR,
  276. :old.PRIVATE_USE_ALLOWED_FROM_DATE,
  277. :old.PRIVATE_USE_ALLOWED_TEMP,
  278. :old.PRIVATE_USE_ALLOWED_TO_DATE,
  279. :old.STATUS_DESCRIPTION,
  280. :old.TECHNICAL_CONTROL_DATE,
  281. :old.VEHICLE_STATUS_ID,
  282. :old.VEH_FCT,
  283. :old.WARANTY_EXPIRATION_DATE,
  284. :old.DO_NOT_INVOICE_IF_NO_DATA,
  285. :old.VEHICLE_SPEED_TYPE_ID,
  286. :old.OBU,
  287. :old.COMPUTE_VEHICLE_ACTIVITY,
  288. :old.VEHICLE_ECO_PROFILE_ID,
  289. :old.LAST_CONTAINER_VEHICLE_ID,
  290. :old.DEFAULT_CONTAINER_VEHICLE_ID,
  291. :old.ACT_INST_TYPE,
  292. :old.REQ_INST_TYPE,
  293. :old.USE_DRIVER_BADGE_EVENT,
  294. :old.ERP_ARTICLE_DESC_FR,
  295. :old.ERP_ARTICLE_DESC_UK,
  296. :old.ERP_INTERNAL_ORDER_NUM,
  297. :old.TYPE,
  298. :old.MTM,
  299. :old.MTM_SLEEP,
  300. :old.SINGLE_WEIGHT,
  301. :old.MAX_CHARGE,
  302. :old.EURONORM,
  303. :old.TACHOGRAPH,
  304. :old.TACHOGRAPH_TYPE,
  305. :old.PERIODIC_MAINTENANCE_PTO_HR,
  306. :old.BADGE_MEANS_WORK_TIME,
  307. :old.AVG_DAY_HR,
  308. :old.AVG_DAY_KM,
  309. :old.LAST_EQUIPMENT_STORE_PLACE_ID,
  310. :old.GRAPHICAL_SYMBOL_ID,
  311. :old.VO_OP_STATUS_ID,
  312. :old.REAL_OWNER_NAME,
  313. :old.REAL_OWNER_SHORT_NAME,
  314. :old.VO_CLASS_TREE_ID,
  315. :old.LAST_RU_TECHNICAL_STATUS_ID,
  316. :old.IS_CLONE_OF_VEHICLE_ID,
  317. :old.LAST_INVENTORY_DATE,
  318. :old.LAST_INVENTORY_BOX_CHECKED
  319. );
  320. end if;
  321. end;
  322.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement