Is it possible to run Stored Procedures on MySQL 4.x? Yes and no
- of course the feature is not available directly in MySQL 4.x,
but if you have a MySQL 5.x server with the FEDERATED Storage
Engine available, it's no big deal to accomplish that.
Here's how it works - we start with this on a MySQL 4.x
server:
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 4.0.18-nt |
+-----------+
1 row in set (0.03 sec)
mysql> SHOW CREATE TABLE tt \G
*************************** 1. row ***************************
Table: tt
Create Table: CREATE TABLE `tt` (
`id` int(10) unsigned NOT NULL auto_increment,
`val` int(10) unsigned NOT NULL default '0',
`ts` timestamp(14) NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM
1 row in set (0.03 sec)
mysql> SELECT * FROM tt;
Empty set (0.03 sec)
The next step …