Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2004

Tip: Looking for answers? Try searching our database.

registering UDF from shell script

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mailar@gmail.com - 22 Dec 2004 12:43 GMT
Hi,
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
mailar
Serge Rielau - 22 Dec 2004 14:09 GMT
> Hi,
> I am trying to register my UDF named 'myUDF.sql" (which has @ as its
[quoted text clipped - 18 lines]
> Thanks in advance
> mailar

Smells like a path problem. Try the full path-name.
If the problem were related the termination character you should get
either an -104 (end of statement reached but expected ';') or a failure
from CLP noting "end of file reached".

Cheers
Serge
mailar@gmail.com - 23 Dec 2004 06:17 GMT
> > Hi,
> > I am trying to register my UDF named 'myUDF.sql" (which has @ as its
[quoted text clipped - 26 lines]
> Cheers
> Serge

Hi Serge
I tried giving full path name of the UDF.
Now I get a new error which says

DB21004E  You cannot specify both an input file and a command when
invoking
the Command Line Processor.

So, is there a way I can do away with this error and register my UDf
via the script

Thanks
mailar
Serge Rielau - 23 Dec 2004 14:38 GMT
>>>Hi,
>>>I am trying to register my UDF named 'myUDF.sql" (which has @ as
[quoted text clipped - 49 lines]
> Thanks
> mailar

Interesting. Not being a script person I wonder whether @ has any
meaning to sh (?)
Can you repcae it with another character? E.g. %, $, #  ?
dotyet - 24 Dec 2004 17:45 GMT
Are you doing something similar to this in your shell script?

<complete_path_to_db2_binary>/db2 "connect to sample"

<complete_path_to_db2_binary>/db2 -td@ -f
<complete_path_to_script>/myUDF.sql

take care that the double quotes are present.  also i don't think the
'v'erbose option is needed, but thats just my opinion.

regards,
dotyet
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.