473,714 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\SQLLI B\BIN>db2 +c "delete from test.table1 where
field1=
1"
DB20000I The SQL command completed successfully.

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

ROLLBACK WORKS

Nov 9 '06 #1
4 23442
no_spam_for_gma n 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\SQLLI B\BIN>db2 +c "delete from test.table1 where
field1=
1"
DB20000I The SQL command completed successfully.

C:\Program Files\IBM\SQLLI B\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_gma n 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_gma n 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\SQLLI B\BIN>db2 +c "delete from test.table1 where
field1=
1"
DB20000I The SQL command completed successfully.

C:\Program Files\IBM\SQLLI B\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
9913
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
37206
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 SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: 12-14-2004 17:45:55 SQL0204N "TABLE_NAME" is an undefined name.
12
2196
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: -- Initialize the temp tables............ create procedure myschema.init_ebom_tables ( ) language sql
1
5193
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 names because it works in the command window. The call is to apiGetShortPathName from the kernel. It works great for returning the short name for the xls file I am zipping. But then when I use the same path and name with a zip extension is...
2
2714
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 Barry
2
9755
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 If you could provide me with sample code, I'd really appreciate you. I need this ASAP..
11
7530
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 quotes around "abc def" is gone, but I need to pass the complete command line ("abc def" xyz) to the browser, how can I do this?
6
1675
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 I just can't see to figure out how to execute the program from the command line. My file is test.cpp and the paramter is to print something. Here are my questions: At the command prompt I type: a.. "test Mike "... file not recognize. b.. ...
1
28144
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 remote 10.134.5.10 server 50000 3) create database mynewdb we are getting the below error message. SQL1096N The command is not valid for this node type.
0
9307
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...
0
9170
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9071
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,...
1
6627
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5943
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
4462
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2105
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.