473,657 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 UDF calling external application

Group.. We are running on db2 UDF V8 on Sun solaris platform. I
created an UDF which calles a C-routine(SQL_API _FN). This C-routine in
turn calls an external C-function. The C-function is provided to us by
a vendor(PCMILER application). The C-Function does the following
operations- Open the server,get distance between two points and close
the server. It takes two input parameters(poin ts).
Whenever I call UDF via select statement it always retrieves 1. On
further analysis it is not able to open the server.
The function is working fine when I called through a C program.
When I contacted the vendor, they said DB2 is not able to load
pcmiler libraries during run time because we use setuid in the bldrtn
script. So I copied all pcmiler libraries to /usr/lib and reexecuted
the udf..Still no luck. The server was not able to open & the udf
always returns 1.
Has any one overcome this issue while calling external applications
via udf. What needs to be done to load external application libraries
to db2 during run time.Any help is greatly appreciated.
Thanks
Siva
Nov 12 '05 #1
4 4959
Do you know for certain that the UDF failed to load? If that's the case
one of the dependent libraries might still not be accessable...as a
'quick test' for this you could change the owner of your
sqllib/adm/.fenced file to be the instance owner, recycle the instance,
and try to run the UDF (make sure you switch back the owner after your
test).

If the load works when run as the instance owner, then you'll need to
figure out what library remains inacessable (doesn't have read access to
other).

Sivakumar Shanmugam wrote:
Group.. We are running on db2 UDF V8 on Sun solaris platform. I
created an UDF which calles a C-routine(SQL_API _FN). This C-routine in
turn calls an external C-function. The C-function is provided to us by
a vendor(PCMILER application). The C-Function does the following
operations- Open the server,get distance between two points and close
the server. It takes two input parameters(poin ts).
Whenever I call UDF via select statement it always retrieves 1. On
further analysis it is not able to open the server.
The function is working fine when I called through a C program.
When I contacted the vendor, they said DB2 is not able to load
pcmiler libraries during run time because we use setuid in the bldrtn
script. So I copied all pcmiler libraries to /usr/lib and reexecuted
the udf..Still no luck. The server was not able to open & the udf
always returns 1.
Has any one overcome this issue while calling external applications
via udf. What needs to be done to load external application libraries
to db2 during run time.Any help is greatly appreciated.
Thanks
Siva

Nov 12 '05 #2
Hi Sean..Thanks.. Well I tried this method..Still no luck. It always
retrieves 1 only. Since I created pcmiler program as a C program and
linked it's object code in buildrtn program.. Does the bldrtn takes
care on loading pcmiler library files..Thanks.
~ Siva

Sean McKeough <mc******@nospa m.ca.ibm.com> wrote in message news:<bt******* ***@hanover.tor olab.ibm.com>.. .
Do you know for certain that the UDF failed to load? If that's the case
one of the dependent libraries might still not be accessable...as a
'quick test' for this you could change the owner of your
sqllib/adm/.fenced file to be the instance owner, recycle the instance,
and try to run the UDF (make sure you switch back the owner after your
test).

If the load works when run as the instance owner, then you'll need to
figure out what library remains inacessable (doesn't have read access to
other).

Sivakumar Shanmugam wrote:
Group.. We are running on db2 UDF V8 on Sun solaris platform. I
created an UDF which calles a C-routine(SQL_API _FN). This C-routine in
turn calls an external C-function. The C-function is provided to us by
a vendor(PCMILER application). The C-Function does the following
operations- Open the server,get distance between two points and close
the server. It takes two input parameters(poin ts).
Whenever I call UDF via select statement it always retrieves 1. On
further analysis it is not able to open the server.
The function is working fine when I called through a C program.
When I contacted the vendor, they said DB2 is not able to load
pcmiler libraries during run time because we use setuid in the bldrtn
script. So I copied all pcmiler libraries to /usr/lib and reexecuted
the udf..Still no luck. The server was not able to open & the udf
always returns 1.
Has any one overcome this issue while calling external applications
via udf. What needs to be done to load external application libraries
to db2 during run time.Any help is greatly appreciated.
Thanks
Siva

Nov 12 '05 #3
Sivakumar Shanmugam <js*********@ho tmail.com> wrote:
Hi Sean..Thanks.. Well I tried this method..Still no luck. It always
retrieves 1 only. Since I created pcmiler program as a C program and
linked it's object code in buildrtn program.. Does the bldrtn takes
care on loading pcmiler library files..Thanks.
~ Siva


Hi Siva,

Hazve you already tried what I wrote in my mail yesterday, i.e. fixing the C
function signature of UDF?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4
I agree with Knut...most likely there is some other problem (not library
loading, maybe the signature).

Sivakumar Shanmugam wrote:
Hi Sean..Thanks.. Well I tried this method..Still no luck. It always
retrieves 1 only. Since I created pcmiler program as a C program and
linked it's object code in buildrtn program.. Does the bldrtn takes
care on loading pcmiler library files..Thanks.
~ Siva

Sean McKeough <mc******@nospa m.ca.ibm.com> wrote in message news:<bt******* ***@hanover.tor olab.ibm.com>.. .
Do you know for certain that the UDF failed to load? If that's the case
one of the dependent libraries might still not be accessable...as a
'quick test' for this you could change the owner of your
sqllib/adm/.fenced file to be the instance owner, recycle the instance,
and try to run the UDF (make sure you switch back the owner after your
test).

If the load works when run as the instance owner, then you'll need to
figure out what library remains inacessable (doesn't have read access to
other).

Sivakumar Shanmugam wrote:

Group.. We are running on db2 UDF V8 on Sun solaris platform. I
created an UDF which calles a C-routine(SQL_API _FN). This C-routine in
turn calls an external C-function. The C-function is provided to us by
a vendor(PCMILER application). The C-Function does the following
operations- Open the server,get distance between two points and close
the server. It takes two input parameters(poin ts).
Whenever I call UDF via select statement it always retrieves 1. On
further analysis it is not able to open the server.
The function is working fine when I called through a C program.
When I contacted the vendor, they said DB2 is not able to load
pcmiler libraries during run time because we use setuid in the bldrtn
script. So I copied all pcmiler libraries to /usr/lib and reexecuted
the udf..Still no luck. The server was not able to open & the udf
always returns 1.
Has any one overcome this issue while calling external applications
via udf. What needs to be done to load external application libraries
to db2 during run time.Any help is greatly appreciated.
Thanks
Siva

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8053
by: chandan | last post by:
Is it possible to call an external java program from a trigger in oracle 8i. I know that you can call a stored procedure in java from a trigger but i want to know is it possible to call an external java program
0
1150
by: Alex | last post by:
Hi I have an external assembly which I call from a windows forms application. What I want to do is terminate the calling application from within the assemnly - or otherwise ensure that the calling application has terminated before the code in the assembly starts executing. Anyone know how I would do this? Thanks Alex.
11
1960
by: j23 | last post by:
I have library (static) testlib.cpp: #include <stdarg.h> void xxx(...) { char buf; va_list args; va_start(args, buf); va_end(args); }
3
2709
by: Gustavo L. Fabro | last post by:
Greetings! I'm a newbie in Visual C++ .NET (have programmed in Borland C++ and Builder for long) and I am trying to do a very simple thing, but I'm stuck. I created an (unmanaged) DLL project with a sample function, and tried to call it from a ".NET Forms" project. All I get are "Unresolved External" errors from the Linker!
17
2190
by: Bill Grigg | last post by:
I have been successfully calling DLL's using VC++ 6.0 and also using VC++7.1 (.NET). I only mention this because I have never felt comfortable with the process, but nonetheless it did work. Recently I started calling an unmanaged DLL from a .NET app. It worked fine. Now I have the situation where I am trying to call a function in one DLL from another DLL. Both are unmanaged and are built with VC++7.1. In the calling DLL I set the property...
5
1742
by: James Radke | last post by:
Hello, I am using VB.NET to call an unmanaged DLL which contains some functions. When I call the DLL from a windows application, it all works fine. When I place the same code in a webform application, my call to the first initialization routine simply hangs (i.e. in debugger it shows the code starts executing, but control never comes back to the debugger). This DLL uses the MFC42.DLL and MSVCRT.DLL which is in the WINNT/SYSTEM32...
6
1697
by: Amjad | last post by:
Hi, I want to make a project that calls and executes a function (VB code) made in a seperate file in the Application Folder. I know I can create the function in my project and call it internally, but I want to put the function's code in an external file, so that future updates to the function will require a replacing the function file instead of re-installing the whole project. Can you give me ideas on how I can make small updates to my...
5
2310
by: Shereef | last post by:
Hi All, I need to call an external application from my javascript and that external appn(c or c++) should give an html page back to me and i need to produce that new html page to the user. will this idea work? Pls help me with a solution. I would like to avoid java,.net or webserver.
6
4929
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
ASP.NET 2.0 / Visual Studio 2005 / VB.Net 2.0 I have a web interface that needs to launch a java application. What a long strange trip it has been... I am using Process.Start process start info parameters, first to launch the java app by itself with the call: "C:\Program Files\Java\jdk1.5.0_12\bin\java.exe" javaAppName Arg1 Arg2
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.