If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Encount db21004E while run the db2cmd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-18-07, 08:57
joeyee joeyee is offline
Registered User
 
Join Date: Dec 2007
Posts: 2
Question Encount db21004E while run the db2cmd

Hello,

db2cmd -c -i -w db2 -tvf c:\\program files\myscript\script.sql

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

The problem is caused by the space in the path. So i tried
db2cmd -c -i -w db2 -tvf "c:\\program files\myscript\script.sql"
and
db2cmd -c -i -w "db2 -tvf c:\\program files\myscript\script.sql"

Still the same error.

How can i fix it?

My environment:
OS: w2k
C:\Documents and Settings\Administrator>db2level
DB21085I Instance "DB2" uses "32" bits and DB2 code release "SQL09010" with
level identifier "02010107".
Informational tokens are "DB2 v9.1.0.356", "s060629", "NT32", and Fix Pack "0".
Product is installed at "C:\IBM\SQLLIB" with DB2 Copy Name "DB2COPY1".


Joeyee

Last edited by joeyee; 12-18-07 at 09:06.
Reply With Quote
  #2 (permalink)  
Old 12-18-07, 10:07
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
create sonewhere a small bat file that will be called and executes the db2 -tvf command
eg.C:\temp>type test.bat
db2 -tvf "c:\program files\test.sql"
db2cmd -w c:\temp\test
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #3 (permalink)  
Old 12-18-07, 10:17
joeyee joeyee is offline
Registered User
 
Join Date: Dec 2007
Posts: 2
To guyprzytula,

Thanks for your solution.

But do you think it is the limitation of the db2? Is there any other solutions which won't create a bat file? I just want to keep my original style of calling the db2cmd.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On