Hi Steve,
What you can do is to create a "User Defined Routine", stored procedure or function, invoking an "External Routine"
The principle is to refer to an "external name" pointing to the fullpath of a .so file ( C source compiled as shared library ). The same mechanics works with java archive files.
This should work in IDS 10.0. check your product documentation at "Programming/SQL/Guide to SQL

yntax/Other syntax segments/External routine reference"
I also recommend to read this excellent post at
oninit's blog site
who should make you happy.
Hope this helps
Eric