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
Why Use Cursor Variables ? Primarily, you use the cursor variables to pass the query result sets between the PL/SQL stored subprograms and different clients. Neither PL/SQL nor

Initial thought process: Design a script which was simple and user friendly. Integrate procedures/functions to extract data under the hood. I focused on giving the user the opt

SELECT INTO Statement   The SELECT INTO statement retrieve data from one or more database tables, and then assigns the selected values to the variables or fields. Syntax:

"Not Enforced" Table Constraints A constraint that is not enforced is not really a constraint within the meaning of the act, but SQL does have such a concept and it needs to b

Using Operator VALUE: As you may expect, the operator VALUE returns the value of an object. The VALUE takes its argument a correlation variable.  For illustration, to return a

GOTO Statement   The GOTO statement branches categorically to a block label or statement label. The label should be exclusive within its scope and should precede a PL/SQL bloc

Difference between 9i & 10G When Oracle releases any new databases then it are having some discrepancy with them. But 10G is having much difference than oracle 9i has. Oracle

Example of Null operator - NiNo Rule If we wanted to make HIGHER_OF adhere to "NULL in, NULL out"-let's call it the NiNo rule-we would have to write something like what is sho

Advantages of Packages The benefits of the Packages are as shown below: Modularity The Packages encapsulate logically associated items, types, and subprograms in the

SSRS Report Writing Project Description: This report is part of a larger project to make a SQL Server Reporting Service (SSRS) based reporting solution. There can be more rep