473,791 Members | 2,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Executing DB2 commands from Windows command prompt

1 New Member
Hi,

Please help me, if theres a way we can execute DB2 commands directly from the windows cmd prompt window instead of executing those from DB2 CLP window.
I need to connect to a DB2 database and run a .sql script. I should have these commands in a batch file that should be executed from windows cmd prompt.

The cmds that wrk from DB2 CLP window are -
db2 connect to <database> user <user_name> using <passwd>
db2 -td! -vf <file_name>

These cmds doesn't work if we execute them directly from the windows cmd prompt window.

Thanks and Regards
Srivalli
Aug 29 '07 #1
2 19422
docdiesel
297 Recognized Expert Contributor
Hi,

try the "db2cmd" command. This opens a cmd windows with db2 environment, so that the commands you listed should work.

Regards, Bernd
Aug 29 '07 #2
naval123
14 New Member
HI ...

You can use "command window" instead of CLP


Naval
Aug 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1937
by: Erhan | last post by:
Hello, after a recent move to windows API from terminal I come across a small problem. How can I execute a program without using stdlib.h ? Before I would use stdlib.h by using a command such as system("myprogram.exe"); to execute a program. When using windows API the terminal window pops up and carries out the command in the terminal. This looks ugly, and I am looking for an alternative to executing a program without the use of terminal...
2
21555
by: Rudolf Bargholz | last post by:
Hi, DB2 Version 7.1 FP11 on Windows XP I have a text file containing SQL. The text file was created using db2look. CONNECT TO MYDB user db2admin using xxxxxx;
2
1744
by: Harley | last post by:
Hey, I want to have a small command prompt type shell in one of my forms that will allow a user to issue dos(if i can still call it dos) commands from within my windows for and show the output from that command in a textbox or label. For the life of me I can see any way to do it. The closest thing I have found to what i need is system.diagnostics.process.start() but its limmitted to fireing off an exicuteable, url or other resource in...
8
2328
by: AG | last post by:
Hello, This is my first post to this group, and on top of that I am a beginner. So please direct me to another group if this post seems out of place.... I have recently written a program which calculates loan amortization schedules, writes the data to a text file, and then upon user prompt, the program will display the created file and print the file. Until this morning, everything worked fine, and then I started messing around with...
6
39518
by: Shooter4Life8 | last post by:
Hi, I am having trouble figureing out the best way to open a command prompt then write lines to it in VB.NET. Currently I have this code, but it execute's too fast I think because Dim psi As Object = New ProcessStartInfo psi.FileName = "cmd.exe" System.Diagnostics.Process.Start(psi) SendKeys.Send("abcdefg" & "{enter}") SendKeys.Send("12345678" & "{enter}")
3
1683
by: Ara Kooser | last post by:
Hello all, I hope I am posting this correctly. I am running Python 2.4.2 on Slackware 11.0 using IDLE. I am in the process of learning python so I am writing a text adventure game using functions and global variables only. I know there is a better way to do this but that is for later. When I run the python program it works fine until I try to go west from my inital start room. I get the room description but no raw_input prompt. I just...
6
3807
by: nsjmetzger | last post by:
I have a script that runs fine in Windows 2003 (32-bit). It basically calls the Windows defrag command. When I try the exact same code on Windows 2003 (64-bit) I get the following message: C:\Scripts>autodefrag.py Starting defragment: defrag -v C: >>c:/Scripts/DEFRAG20070502.log 'defrag' is not recognized as an internal or external command, operable program or batch file. I have tried defrag.exe and even giving it the full path to
1
3559
by: raocheng | last post by:
Please see the following code. Suppose I have many shell commands to be executed. And I don't want to fork a sub shell for each command(eg: status,output = commands.getstatusoutput(cmd)) because it is too expensive. I want to use only one sub shell to execute all these commands and want to get each command's output. How can I accomplish this task ? Thanks in advance. =========================================== #!/usr/bin/env python
2
5628
by: rcook349 | last post by:
I'm trying to automate our builds and publishes of our Windows application (deployed to a website via ClickOnce). I'm getting close, I think, on the commands I need to execute. However, how do I put these commands in some sort of executable file? I thought at first a VBScript file (Windows script), but from what I'm reading that is old techology. A script in PowerShell? Not too familiar with this?
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.