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 / January 2006

Tip: Looking for answers? Try searching our database.

[db2clpex] How to pass the content of a clp-file as a parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SaschaMoe@web.de - 26 Jan 2006 17:22 GMT
Hi,

I want to pass the content of a clp-file as a parameter for db2clpex?
E.g.:

db2clpex db2 -z log.txt -tvf "connect to mydb user myuser using
mypassword;select * from table;connect reset", but I don't know how to
pass more than one command using a string (separated by semicolon).

Any ideas?

Thank you,
Sascha
Gert van der Kooij - 26 Jan 2006 17:35 GMT
> db2clpex db2 -z log.txt -tvf "connect to mydb user myuser using
> mypassword;select * from table;connect reset", but I don't know how to
> pass more than one command using a string (separated by semicolon).

You need to specify an input file, not the CLP commands within that
file.
SaschaMoe@web.de - 26 Jan 2006 17:50 GMT
So, it is not possible to pass at least the username and password as
parameters, because I don't want to write username and password in the
input file.

Thank you,
Sascha
Knut Stolze - 26 Jan 2006 17:55 GMT
> So, it is not possible to pass at least the username and password as
> parameters, because I don't want to write username and password in the
> input file.

I would write a shell or perl script in such a case.

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

SaschaMoe@web.de - 26 Jan 2006 18:25 GMT
OK, sounds great, but could you please give me an example?

Thank you,
Sascha
Gert van der Kooij - 26 Jan 2006 18:49 GMT
> OK, sounds great, but could you please give me an example?
>
> Thank you,
> Sascha

A very simple example without error checking which doesn't need any
additional software:

File: runclp.bat

Contents:

db2 connect to $1 user $2 using $3
db2 select * from table
db2 connect reset

Command to run this:
 runclp yourdb youruser yourpw

You can also learn a scripting language and add the needed error
checking to it. I use ooRexx for my scripts, it's free and you can
download it fom the sourceforge project page.
 
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



©2009 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.