CodeMirror: Oracle PL/SQL mode

1
-- Oracle PL/SQL Code Demo
2
/*
3
   based on c-like mode, adapted to PL/SQL by Peter Raganitsch ( http://www.oracle-and-apex.com/ )
4
   April 2011
5
*/
6
DECLARE
7
    vIdx    NUMBER;
8
    vString VARCHAR2(100);
9
    cText   CONSTANT VARCHAR2(100) := 'That''s it! Have fun with CodeMirror 2';
10
BEGIN
11
    vIdx := 0;
12
    --
13
    FOR rDATA IN
14
      ( SELECT *
15
          FROM EMP
16
         ORDER BY EMPNO
17
      )
18
    LOOP
19
        vIdx    := vIdx + 1;
20
        vString := rDATA.EMPNO || ' - ' || rDATA.ENAME;
21
        --
22
        UPDATE EMP
23
           SET SAL   = SAL * 101/100
24
         WHERE EMPNO = rDATA.EMPNO
25
        ;
26
    END LOOP;
27
    --
28
    SYS.DBMS_OUTPUT.Put_Line (cText);
29
END;
30
--
31
 
 
 

!! This mode is deprecated in favor of the generic SQL mode (which can be configured to handle PL/SQL).

Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course).

MIME type defined: text/x-plsql (PLSQL code)