1
0

index.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>CodeMirror 2: Oracle PL/SQL mode</title>
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="plsql.js"></script>
  8. <link rel="stylesheet" href="../../theme/default.css">
  9. <link rel="stylesheet" href="../../css/docs.css">
  10. <style>.CodeMirror {border: 2px inset #dee;}</style>
  11. </head>
  12. <body>
  13. <h1>CodeMirror 2: Oracle PL/SQL mode</h1>
  14. <form><textarea id="code" name="code">
  15. -- Oracle PL/SQL Code Demo
  16. /*
  17. based on c-like mode, adapted to PL/SQL by Peter Raganitsch ( http://www.oracle-and-apex.com/ )
  18. April 2011
  19. */
  20. DECLARE
  21. vIdx NUMBER;
  22. vString VARCHAR2(100);
  23. cText CONSTANT VARCHAR2(100) := 'That''s it! Have fun with CodeMirror 2';
  24. BEGIN
  25. vIdx := 0;
  26. --
  27. FOR rDATA IN
  28. ( SELECT *
  29. FROM EMP
  30. ORDER BY EMPNO
  31. )
  32. LOOP
  33. vIdx := vIdx + 1;
  34. vString := rDATA.EMPNO || ' - ' || rDATA.ENAME;
  35. --
  36. UPDATE EMP
  37. SET SAL = SAL * 101/100
  38. WHERE EMPNO = rDATA.EMPNO
  39. ;
  40. END LOOP;
  41. --
  42. SYS.DBMS_OUTPUT.Put_Line (cText);
  43. END;
  44. --
  45. </textarea></form>
  46. <script>
  47. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  48. lineNumbers: true,
  49. matchBrackets: true,
  50. indentUnit: 4,
  51. mode: "text/x-plsql"
  52. });
  53. </script>
  54. <p>
  55. Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course).
  56. </p>
  57. <p><strong>MIME type defined:</strong> <code>text/x-plsql</code>
  58. (PLSQL code)
  59. </html>