472,139 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 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 22928
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Christian Long | last post: by
11 posts views Thread by wangzq | last post: by
6 posts views Thread by News | last post: by

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.