abirama62

update_outlet_name

Jun 10th, 2020
293
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --update table t_ou
  2. UPDATE t_ou
  3. SET ou_name = CONCAT(ou_code, ' - ', ou_name), update_datetime = vCurrentDate, update_user_id = vUserId, version+1
  4. WHERE tenant_id = vTenantId
  5.  
  6. --update table i_outlet
  7. UPDATE i_outlet X
  8. SET outlet_name = CONCAT(A.ou_code, ' - ', outlet_name), update_datetime = vCurrentDate, update_user_id = vUserId, version+1
  9. FROM t_ou A
  10. WHERE X.tenant_id = vTenantId
  11. AND X.ou_id = A.ou_id
  12. AND X.tenant_id = A.tenant_id
RAW Paste Data