Pl sql code review, PL-SQL Programming

PL SQL Code Review

HEADER ELEMENTS

File Name

Clear, meaningful and descriptive about main objective of the file. Multiple words are joined using underscores which adheres to the file naming standards.

Purpose

Brief description of the functionality of the Code.

Usage

Method of calling the SQL in the prompt to the test the Code.

Date

when the development of the Code was started.

Edit History

History of changes made to the Code. Update Edit History in case of Change Request to reflect the changes made in the code.

Author (Company Name)

Use standard Boiler Plate given by the client.

Coding Conventions Systematize and Automate

Use code templates to design and make available headers and structures. Build your checklists into these templates!

Use automated formatters at both the individual and team levels. Do not manually format your code. Big waste of time.

General Guidelines while Coding

(i) Standard (space-based) block nesting indentations should be two spaces

(ii) Avoid Using TABS for indendation, use spaces instead

(iii) All the Keywords of SQL should be in CAPS

(iv) The functional overview comment of a routine should be indented two spaces. The highest-level statements that follow the overview comment should be in the same column

As comment, with each nested block indented by two spaces

(v) Adequate blank lines should be left to aid readability of source code

(vi) Proper Indentations should be used when writing PL/SQL code, like IF and ENDIF, LOOP and END LOOP should line up correctly.

(vii) Use SQL%ROWCOUNT to increment counters after Insert/Update/Delete statements.

(viii) There should not be more than one expression per line

(ix) A blank line should separate the code and DECLARE/ BEGIN/EXCEPTION/ END.

(x) The beginning of stored procedure should start with ‘BEGIN’ in uppercase and end with ‘END’ in uppercase.

(xi) Write consistent Log messages using DBMS_OUTPUT package detailing the no of rows updated/inserted/deleted in the tables.

(xii) Give inline comments wherever code is changed in case of CR’s(Client Requests).

(xiii) Application code must raise, handle, log and communicate errors in a consistent, robust manner.

(xiv) Use proper indexes

(xv) Maximise SQL and minimise PL/SQL

(xvi) Instrument your code for debugging - Choose your favourite method: debug statements judiciously places throughout your code, or perhaps using DBMS_PROFILE (that is definitely a topic I'll do soon), or something else entirely. As long as you have a way to troubleshoot bugs and performance issues later on.

Posted Date: 9/21/2012 3:43:48 AM | Location : United States







Related Discussions:- Pl sql code review, Assignment Help, Ask Question on Pl sql code review, Get Answer, Expert's Help, Pl sql code review Discussions

Write discussion on Pl sql code review
Your posts are moderated
Related Questions
I need SQL Data Base Project Description: Network SQL database and SQL Setup two 4 workstation Skills required are Data Entry, MySQL, SQL

IN OUT Mode An IN OUT parameter passes initial values to the subprogram being called and return efficient values to the caller. Within the subprogram, an IN OUT parameter acts

Anatomy of a Command Figure, showing a simple SQL command, is almost identical to its counterpart in the theory book. The only difference arises from the fact that SQL uses a

Order of Evaluation When you do not use the parentheses to specify the order of evaluation, the operator precedence determine the order. Now compare the expressions below: NOT

Inserting Objects: You can use the INSERT statement to add objects to an object table. In the illustration below, you insert a Person object into the object table persons:

EXIT Statement   You can use the EXIT statement to exit a loop. The EXIT statement has 2 forms: the conditional EXIT WHEN and the unconditional EXIT. With the either form, you

Semidifference via NOT IN and a subquery SELECT StudentId FROM IS_CALLED WHERE Name = 'Devinder' AND StudentId NOT IN (SELECT StudentId FROM IS_ENROLLED_ON WHER

Cursor Variables As Parameters You can declare the cursor variables as the formal parameters of the functions and procedures. In the illustration below, you define the REF CUR

Exception handling In the PL/SQL, a warning or error condition is known as an exception. The Exceptions can be internally defined (by the run-time system) or user defined. The

When Are Constraints Checked Under the model constraints are conceptually checked at all statement boundaries (and only at statement boundaries). By default the same is true