Re: UDR with esqlc ?
Posted in 1998
Ilona Stoffel wrote: > I wonder wether I could register an esqlc function as an UDR in my > database. > I tried to build a shared object libary with my function in it with a > 'cc -G function.o -o lib.so' - line. And I tried to register it in > the database. There where no error message but I could not execute > it. So I tried to run it within a C - program that links the lib.so, > but the '.so' file could not be accessed. > What was wrong ? > > (I'm using IDS 9.14 on sun solaris.) There are two problems: (1) running ESQL/C programs at all, and (2) using ESQL/C in UDRs. (1) The system has to know where to find the shared libraries at runtime as well as at link time. The esql script provides the link time locations with -L$INFORMIXDIR/lib and -L$INFORMIXDIR/lib/esql, but this is no help at run time. You can set LD_LIBRARY_PATH to include the library directories, or you can include -R$INFORMIXDIR/lib -R$INFORMIXDIR/lib/esql on the link line (Solaris only); you could also explore the LD_RUN_PATH environment variable, but I've never used it and haven't worked out what it's really for. (2) ESQL/C programs talk to the database over a connection. Trying to embed an ESQL/C routine inside the database in a UDR therefore doesn't work because your trying to use the client-side connection code on the server-side of the database system. There are distinct rules about what you can put into a UDR -- you'll need to read the docs, the same as I need to read them. You're likely to use the mi_* family of routines. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>