Category: Software Preview

ProjectPage External Language Stored Procedures

This project is a possible implementation of WorkLog#820: External Language Stored Procedures

Contents

[edit] Documentation

[edit] Source Downloads

Current development tree:

Legacy download

Source tarballs and patches are automatically generated at midnight PST.

Please do not link to actual files as they may not exist after next update.

Freshmeat Project Page

[edit] External Language Plug-ins

The following external language plug-ins are currently operational, planned or in development:


[edit] C Language Plug-in

Status: planning

Requirements:


[edit] Java Language Plug-in

Status: working

Requirements:

Note:


[edit] LegacyUDF Language Plug-in

Status: finished but not tested

Note:


[edit] Perl Language Plug-in

Status: working

Requirements:

Sample stored Perl routine:

sub test1()
{
  my $dsn= "DBI:mysql:test";
  my $dbh= DBI->connect($dsn, undef, undef) or
      die "Failed to obtain connection";
  # Putting a WRITE lock on this table before calling this routine
  # will not cause deadlock because this INSERT will occur
  # within the same thread context.
  $dbh->do("INSERT INTO t1 (txt) VALUES ('hello world')");
  return 0;
}

Example:

mysql> CREATE TABLE test.t1 (
   seq INT NOT NULL AUTO INCREMENT PRIMARY KEY,
   txt VARCHAR(128));
mysql> CREATE PROCEDURE test.test1()
   LANGUAGE Perl MODIFIES SQL DATA
   EXTERNAL NAME 'MyDBIExample::test1';
mysql> LOCK TABLE test.t1 WRITE;
mysql> CALL test.test1();
mysql> UNLOCK TABLES;
mysql> SELECT * FROM test.t1;
+-----+-------------+
| seq | txt         |
+-------------------+
|   1 | hello world |
+-------------------+

[edit] XML-RPC Language Plug-in

Status: working

Requirements:

Example:

mysql> create function xml_get_state(id int) returns text
-> no sql language xmlrpc external name
-> 'xmlrpc://betty.userland.com/RPC2;examples.getStateName';
Query OK, 0 rows affected (0.00 sec)

mysql> select xml_get_state(40);
+-------------------+
| xml_get_state(40) |
+-------------------+
| South Carolina |
+-------------------+
1 row in set (0.42 sec)


[edit] TO DO

[edit] Project Authors

Retrieved from "http://forge.mysql.com/wiki/ProjectPage_External_Language_Stored_Procedures"

This page has been accessed 2,460 times. This page was last modified 17:14, 11 May 2008.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...