Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. declare
  2. l_need_comma boolean := false;
  3. begin
  4. -- Create "dictionary" arrays:
  5. -- deptDic for Departments
  6. -- They are used for the populating the Select2 items
  7. -- that already have codes and avoid an extra AJAX call for each one.
  8. sys.htp.p('<script>');
  9.  
  10. sys.htp.prn('var shipDic={');
  11.  
  12. for d in (
  13. select d.item_shtname as description,
  14. d.item_code as code
  15. from lgms_lov_v d
  16. where upper(lov_code) = 'SHIPS'
  17. order by 1
  18. )
  19. loop
  20. if l_need_comma then
  21. sys.htp.prn(',');
  22. else
  23. l_need_comma := true;
  24. end if;
  25. sys.htp.prn(d.code || ':"' || replace(d.description, '"','\"') || '"');
  26. end loop;
  27. sys.htp.p('};');
  28.  
  29. sys.htp.p('</script>');
  30.  
  31. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement