Article Preview
Buy Now
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.