Day 21. Extending MySQL's Function Library

MySQL has an extensive and varied function library. However, if the function you want is not already included in that library, it is possible to create it yourself, using MySQL's system of user-definable functions (UDFs).

Today you will learn how to create new functions in MySQL using UDFs.

In particular you will learn

  • How to prepare MySQL for adding UDFs written in C or C++

  • How to add the sample UDFs included with the MySQL distribution as UDFs, including compiling the C programs that define the UDFs and adding them to MySQL using CREATE FUNCTION

  • The details of C calling sequences and datatypes for UDFs so that existing C programmers can start writing their own UDFs

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.