Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

Article Preview


Buy Now

Print:
PDF:

Databases for Real

Stored Procedures

Part 1: An Overview

Issue: 4.2 (November/December 2005)
Author: Paul Lefebvre
Article Description: No description available.
Article Length (in bytes): 4,058
Starting Page Number: 32
RBD Number: 4214
Resource File(s): None
Related Link(s): None
Known Limitations: None

Excerpt of article text...

If you find yourself working with database servers, you may be wondering about stored procedures. Depending on who you talk to, stored procedures are either something you should definitely be using or something you should avoid like the plague. As with most things in life, the answer is not quite so simple.

What is a Stored Procedure?

A stored procedure (SP) is code that runs on the database server. Generally this code is written in a language that is proprietary to the database server you are working with. Some database servers may support more than one store procedure language. Figure 1 is a table of some common database servers and their corresponding stored procedure languages.

I'll be focusing on the SQL-type programming languages as they are much more commonly used.

Code Listing 1 shows you how a very simple stored procedure looks with PostgreSQL. This is a very simple example that just inserts a row of data into a log table. The syntax across the various databases is similar, but different enough to be annoying when you work with more than one. They become much less similar when you start working with variable declarations, data types, and control structures.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com