Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

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