|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hi,
I am using DB 8.2 platform Red Hat Linux 9. I am trying to register my UDF named 'myUDF.sql" (which has @ as its command terminating character) with sample database I am able to do so through the Linux shell prompt using the following sequence of commands db2 connect to sample db2 -td@ -vf myUDF.sql But if I make a shell script say script1.sh and write these two commands in it and try to run the shell script as sh script1.sh then it says (error) B21005E An error occurred while accessing the file myUDF.sql So can someone help me do this. Thanks in advance |
|
#2
|
||||
|
||||
|
The reason is because when you are logged in you have the db2 profile sourced into your profile, but bash by default does not.
Try adding the following below the shebang line in your bash script: . /etc/profile.d/db2.sh There is a space between the period and /etc Also, you may have to change the path accordingly to where the db2 profile is located. |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > Registering UDF from a shell script (Linux Red hat) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|