Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 4.3

COLUMN

Stored Procedures

Part 2: An Overview

Issue: 4.3 (January/February 2006)
Author: Paul Lefebvre
Author Bio: Paul Lefebvre is President and Chief Software Architect of LogicalVue Software, makers of SQLVue, UltraToolBar, and RBUnit.
Article Description: No description available.
Article Length (in bytes): 4,834
Starting Page Number: 30
Article Number: 4313
Related Link(s): None

Excerpt of article text...

Now that we know what stored procedures are, let's take a look at a few more examples. The accompanying Code Listing shows a simple stored procedure for MySQL, PostgreSQL, OpenBase, FrontBase, SQL Server and Oracle. As mentioned last time, the various syntax is similar but also just different enough to be annoying.

How is this related to REALbasic?

REALbasic does not provide a built-in way to call stored procedures, but it provides a nice set of database classes that work with a wide variety of databases. I guess you could say that REALbasic is encouraging you not to use stored procedures at all. That's not entirely true, but most languages do make it a bit easier to work with them. For example, with VB.NET and ADO.NET you can use the ExecuteNonQuery method to call a stored procedure. Java with JDBC also provides a way to call stored procedures.

In the case of REALbasic, you'll need to use the appropriate syntax for your database server to call the stored procedure using SQL.

For example, with Microsoft SQL Server (on Windows, connected via ODBC) you would use this code to run a stored procedure called INSERT_TEST:

mySQLServerODBCDatabase.SQLExecute("exec INSERT_TEST")

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