use oracle unixodbc driver in ibmi

Any IBM i topic that does not fit in another forum
Post Reply
hanspoo
Posts: 3
Joined: Tue Oct 08, 2024 3:25 pm

use oracle unixodbc driver in ibmi

Post by hanspoo »

Can't make Oracle unixodbc driver work in the ibmi.

We have an app that uses unixodbc to call db2, and works fine, know we need to add some oracle databases, but can't make unixodbc to load the oracle drivers, we've tried LIBPATH, dump -H, and ar -rv, all to create the dependencies of the oracle driver, but without success. I would thank anyone who can give me a clue on this, or better if it has experience with this.

Thanks you,
Hans Poo, Chile
Scott Klement
Site Admin
Posts: 799
Joined: Sun Jul 04, 2021 5:12 am

Re: use oracle unixodbc driver in ibmi

Post by Scott Klement »

As far as I know it's not possible to get Oracle UnixODBC drivers for IBM i. That said, it has been perhaps 5 years since the last time I tried.

Have you seen an article or post that implies this should work?
hanspoo
Posts: 3
Joined: Tue Oct 08, 2024 3:25 pm

Re: use oracle unixodbc driver in ibmi

Post by hanspoo »

Hi Scott, thanks for caring,

I've downloaded binaries from Oracle for ppc64, they should work in PASE, i've created the required depdencencies, i.e. creating expected libodbcinst.a with libodbcinst.so.2 using ar, in all this effort, i''ve compiled successfully unixodbc using gcc in pase environment. The 32, 64 bits differences have been hard too, know i'm troubleshouting separately the dlopen library with this code:

#include <dlfcn.h>
#include <stdio.h>

void *mylib;
int eret;

//char* file = "/QOpenSys/pkgs/lib/libcwbodbc.so";
//char* file = "/QOpenSys/pkgs/lib/libsqora.so";

int main(int argc, char** argv) {
char* file = argv[1];

printf("hay %d argumentos\n", argc);

printf("Cargando %s\n", file);


mylib = dlopen(file, RTLD_LOCAL | RTLD_LAZY);
if (mylib == NULL) {
char* error = dlerror();
printf("libreria %s no encontrada, %s\n", file, error);
return(-1);
}

eret = dlclose(mylib);
}

then

gcc dltest.c -o dltest
./dltest /QOpenSys/usr/lib/libsqora.so
Scott Klement
Site Admin
Posts: 799
Joined: Sun Jul 04, 2021 5:12 am

Re: use oracle unixodbc driver in ibmi

Post by Scott Klement »

You shouldn't have to compile unixodbc, it's available in yum.

But, at least years ago, I wasn't able to get the ppc64 binaries for Oracle to work in PASE. I don't remember the details anymore, and its years later now, so things may have changed.

I wish you the best of luck.
hanspoo
Posts: 3
Joined: Tue Oct 08, 2024 3:25 pm

Re: use oracle unixodbc driver in ibmi

Post by hanspoo »

Initially Ii compiled it manually to assemble as archive libodbcinst.a and not as .so that comes with the rpm package, this file is a depdendency of libsqora.so, but lattely i just used ar to create it. Now i've found the "invalid magic number" error that tells that there is no binary compatibilty with oracle code, so, i appreciate your feedback, to end, this is the problem with closed source, something simple becomes impossible.
Post Reply