Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

what's wrong?how to create external routine?thanks.

renx
Occasional Advisor

what's wrong?how to create external routine?thanks.

rdnum.c???
#include

int rdnum()
{
int iRet;

iRet=(int) random();

return iRet;
}

cc -g -c rdnum.c
ar rv librdnum.so rdnum.o


create function "informix".rdnum()
returning int
external name '/export/informix/rxtst/rdnum.so(rdnum)'
language c;

selet rdnum() from billlog;


9793: User Defined Routine (rdnum) module load failed.
rx
3 REPLIES
renx
Occasional Advisor

Re: what's wrong?how to create external routine?thanks.

it's informix sql.
rx
Steve Steel
Honored Contributor

Re: what's wrong?how to create external routine?thanks.

Hi

The online doc at

http://www.informix.com/answers/english/docs/datablade/dbdk/index/global.u.html

Should help

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Steve Lewis
Honored Contributor

Re: what's wrong?how to create external routine?thanks.

Do onstat -m to get more information and also finderr -9793 to get a description.

I got 'bad magic number' when loading the shared object.

16:58:28 Loading Module
16:58:28 The C Language Module can't load
reason: '/home/dba/progs/librdnum.so' is not a valid load module: Bad magic number
16:58:28 (-1): ERROR: Loading Module