0

I have created a batch file and in inside the file i'm executing the below 2 commands in db2 command line.

db2cmd -i -w db2clpsetcp
db2 -tvmf D:\Db2_old.sql > D:\Vikas.log

I need to Pass a parameter to the batch file which will be used in the sql file for the extraction. Is there any way that we can achieve this?

Ravi Kumar
  • 11
  • 4
  • 1
    When you pass parameters/arguments to a batch file, you do it like this `"file.bat" "param1" "arg2"` or `call "file.bat" "param1" "arg2"`. Inside that batch file, those parameters/arguments are available using the `%*` `%1` `%2` etc. variables. The information on those variables is clearly available in the link you have told us does not answer your question. So, you are either incorrect to dismiss that link, or incorrect in explaining your issue. – Compo Jun 18 '21 at 01:37
  • 1
    @Vikas your question (and tags) was badly worded, so it got closed. You should have researched first. Db2 CLP scripts are __not__ batch files and do not take parameters like batch files do, but other ways exist to solve the problem. – mao Jun 18 '21 at 08:13

0 Answers0