Databases
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