Title / Description
Code Already implemented PL/SQL features are : 1. Package Bodies 1.a PL/SQL example CREATE OR REPLACE PACKAGE BODY PKG1 IS ... END PKG1; 1.b Parsed XML example <Package_Body> <Schema_Name>null</Schema_Name> <Name>PKG1</Name> ... </Package_Body> 2. Variable Declarations 2.a PL/SQL example G_SSN VARCHAR2(10) := NULL; 2.b Parsed XML example <Variable> <Name>G_SSN</Name> <Type>VARCHAR2(10)</Type> <Expression> <Type>SIMPLE</Type> <Value>NULL</Value> </Expression> </Variable> 3. SQL Select Statements 3.a PL/SQL example SELECT NAME INTO G_NAME FROM PS_PERSONAL_DATA WHERE EMPLID = P_EMPLID; 3.b Parsed XML example <SQL> <Select> <Column> <Spec>null</Spec> <Name>NAME</Name> <Alias>null</Alias> </Column> </Select> <Into>G_NAME</Into> <From>PS_PERSONAL_DATA</From> <Where>WHERE EMPLID = P_EMPLID</Where> </SQL> 4. Assign statements 4.a PL/SQL example G_NAME := NULL; 4.b Parsed XML example <Statement> <Type>Assign</Type> <LValue>G_NAME</LValue> <RValue> <Expression> <Type>SIMPLE</Type> <Value>NULL</Value> </Expression> </RValue> </Statement> 5. Return statements 5.a PL/SQL example RETURN G_NAME; 5.b Parsed XML example <Statement> <Type>RETURN</Type> <Expression> <Type>SIMPLE</Type> <Value>G_NAME</Value> </Expression> </Statement> 6. GOTO statements 6.a PL/SQL example GOTO label_name 6.b Parsed XML example <Statement> <Type>GO TO</Type> <Label>label_name</Label> </Statement> 7. Raise statements 7.a PL/SQL example RAISE exception_name 7.b Parsed XML example <Statement> <Type>RAISE</Type> <Exception>exception_name</Exception> </Statement> 8. NULL statenent 8.a PL/SQL example NULL 8.b Parsed XML example <Statement> <Type>NULL</Type> </Statement> 9. EXIT statement 9.a PL/SQL example EXIT label_name WHEN plsql_condition ) 9.b Parsed XML example <Statement> <Type>EXIT</Type> <Label>label_name</Label> plsql_condition - parsed like pl/sql conditions or expressions e.g value1 <> value2 </Statement> 10. Function bodies (with parameters, return type and declarations) 10.a PL/SQL example FUNCTION GETEMPLSSN (P_EMPLID OUT VARCHAR2) RETURN VARCHAR2 IS BEGIN END GETEMPLSN; 10.b Parsed XML example <Function> <Name>GETEMPLSSN</Name> <Parameter> <Name>P_EMPLID</Name> <Direction> OUT </Direction> <Type>VARCHAR2</Type> </Parameter> <Return> <Type>VARCHAR2</Type> </Return> </Function> 11. Fuction calls (with parmeters, it's also possible to catch "Param_Name => Param_Value" statement for any param) 11.a PL/SQL example NVL(G_EMPLID1,'X'); 11.b Parsed XML example <Call> <Function> <Name>NVL</Name> <Parameter> <Name>null</Name> <Value> <Expression> <Type>SIMPLE</Type> <Value>G_EMPLID1</Value> </Expression> </Value> </Parameter> <Parameter> <Name>null</Name> <Value> <Expression> <Type>SIMPLE</Type> <Value>'X'</Value> </Expression> </Value> </Parameter> </Function> </Call> 12. Relational operators = -> <Operator>equal</Operator> < -> <Operator>less then</Operator> > -> <Operator>greater then</Operator> <>, !=, ^= -> <Operator>not equal</Operator> <= -> <Operator>less or equal</Operator> >= -> <Operator>greater or equal</Operator> 13. IF-THEN-ELSE statements 13.a PL/SQL example IF NVL(G_EMPLID1,'X') <> P_EMPLID THEN ... END IF; 13.b Parsed XML example <Statement> <Type>IF</Type> <Expression></Expression> - Expression, Fuction call or something like that <Operator></Operator> -- e.g. some relational operator <Expression></Expression> - Expression, Fuction call or something like that <Code_Section> <Type>THEN</Type> ... e.g. SQL, statements, calls, expressions tags </Code_Section> <Code_Section> <Type>ELSE</Type> ... e.g. SQL, statements, calls, expressions tags </Code_Section> </Statement> Please, feel free to express your opinion on how to make it better ... :)
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code