473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

DB2 Command Line Processor (CLP) - How to turn autocommit off within CLP?


Hi,

I can turn off autocommit within the command window but I cannot figure
out how to turn it off when you are in the IBM DB2 Command Line
Processor. Does anybody knows how? By the way I mean when you are
logged on and the prompt is: db2 =>
Here's an example how I do it from Command Window (option is c):

C:\Program Files\IBM\SQLLIB\BIN>db2 +c "delete from test.table1 where
field1=
1"
DB20000I The SQL command completed successfully.

C:\Program Files\IBM\SQLLIB\BIN>db2 rollback
DB20000I The SQL command completed successfully.

ROLLBACK WORKS

Nov 9 '06 #1
4 23324
no_spam_for_gman wrote:
>
Hi,

I can turn off autocommit within the command window but I cannot figure
out how to turn it off when you are in the IBM DB2 Command Line
Processor. Does anybody knows how? By the way I mean when you are
logged on and the prompt is: db2 =>
Here's an example how I do it from Command Window (option is c):

C:\Program Files\IBM\SQLLIB\BIN>db2 +c "delete from test.table1 where
field1=
1"
DB20000I The SQL command completed successfully.

C:\Program Files\IBM\SQLLIB\BIN>db2 rollback
DB20000I The SQL command completed successfully.
Use the "UPDATE COMMAND OPTIONS" command. See:

db2 "? update command options"

UPDATE COMMAND OPTIONS USING {options ...}

options:
a {ON|OFF} Display SQLCA
c {ON|OFF} Auto-commit
e {ON {C|S} | OFF} Display SQLCODE/SQLSTATE
l {ON filename | OFF} Log commands in history file
n {ON|OFF} Remove new line character
o {ON|OFF} Display output
p {ON|OFF} Display db2 interactive prompt
r {ON filename | OFF} Save output report to file
s {ON|OFF} Stop execution on command error
v {ON|OFF} Echo current command
w {ON|OFF} Display FETCH/SELECT warning messages
z {ON filename | OFF} Save all output to file

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 9 '06 #2
Is there a way to turn it off globally? Everytime I log in CLP it
would be off by default as oppose to me turning the option off each
time?

Nov 9 '06 #3
no_spam_for_gman wrote:
Is there a way to turn it off globally? Everytime I log in CLP it
would be off by default as oppose to me turning the option off each
time?
You could use the DB2OPTIONS global variable.

You may want to read The "Command Reference". Both the options, and how
to set them are explain therein.

B.

Nov 9 '06 #4
no_spam_for_gman wrote:
>
Hi,

I can turn off autocommit within the command window but I cannot figure
out how to turn it off when you are in the IBM DB2 Command Line
Processor. Does anybody knows how? By the way I mean when you are
logged on and the prompt is: db2 =>
Here's an example how I do it from Command Window (option is c):

C:\Program Files\IBM\SQLLIB\BIN>db2 +c "delete from test.table1 where
field1=
1"
DB20000I The SQL command completed successfully.

C:\Program Files\IBM\SQLLIB\BIN>db2 rollback
DB20000I The SQL command completed successfully.

ROLLBACK WORKS
Oh, well. In my opinion DB2 CLP is not good, to say the least. At least on
Linux it isn't. I rather use my bash shell to wrtie SQL commands. That way
I have all the goodies that my bash provides like searching, ... :))

Just my opinion.

Best regards,
Kovi
--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Nov 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Christian Long | last post by:
Hi I'm trying to pipe data into a python program on Windows 2000, on the command line. Like this: dir | myProgram.py Here's what I tried:
1
by: Maria | last post by:
Hello we got a script automatically generated to populate a table that belongs to a partition table, then while executing we get this error message: "DB21034E The command was processed as an...
12
by: robertino | last post by:
Hi all, I've put together a few SPs to produce a BOM (bill of materials) listing, which together use a couple of global temp tables, and return the results from a cursor. Here's the code: ...
1
by: hannahg | last post by:
I am trying to incorparate the win zip command line processor in my code on an Access 2003 database form. The code that I downloaded made a call to the windows api. It requires that you use short...
2
by: Barry Flynn | last post by:
I have a VB 2005 Windows Forms program. I am giving it the ability to take some command line arguments. When debugging from within VS2005, how can I specify the command line arguments? Thanks...
2
by: Dsel | last post by:
I need to run a stored procedure in db2 Command Line Processor with two inputs and a CLOB output. I don't know how to call them via CLP to get the CLOB output. The version of DB2 we use is 8.1.14...
11
by: wangzq | last post by:
Hello, I'm passing command line parameters to my browser, I need to pass the complete command line as-is, for example: test.py "abc def" xyz If I use ' '.join(sys.argv), then the double...
6
by: News | last post by:
Hi folks I've got a really easy question yet I can't seem to get an answer from any book. I am playing around with ARGV and ARGC and I think I understand the use of these parameters pretty well but...
1
by: Dayakar Reddy | last post by:
Hi, we are trying to use CLP tool provided by DB2 client installer to create DB2 database. We followed the following steps 1)Invoked command line processor (CLP) 2) catalog tcpip node DB2_01...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.