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 > set autocommit equivalent ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-08-04, 05:00
SamCute SamCute is offline
Registered User
 
Join Date: Mar 2004
Posts: 205
set autocommit equivalent ?

Hi,

What is the DB2 equivalent for "set autocommit on" of Oracle ?

Thanks,
Sam
Reply With Quote
  #2 (permalink)  
Old 07-08-04, 05:07
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
What interface are you using. For the CLI, autocommit is the default.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 07-08-04, 05:12
SamCute SamCute is offline
Registered User
 
Join Date: Mar 2004
Posts: 205
Yes, CLI interface. What should I do to mae it 'off'. Please give the SQL Plus command for the same

Thanks,
Sam
Reply With Quote
  #4 (permalink)  
Old 07-08-04, 05:27
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
For the command:

db2 +c -tvf file-name

the "+c" will turn off autocommit. This is documented in the Command Reference in the discussion about CLI options.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 07-08-04, 06:02
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Arrow Profile Registry

If you want to turn it off permanently
set the variable db2options to +c (counterintuitive!)
using:

db2set db2options=+c

Look into the db2set -? for syntax.

BOW
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #6 (permalink)  
Old 07-08-04, 08:42
SamCute SamCute is offline
Registered User
 
Join Date: Mar 2004
Posts: 205
Hi,

Thanks for your reply.

But, again how to trun it on, with the same statement ?


Thanks,
Sam
Reply With Quote
  #7 (permalink)  
Old 07-08-04, 08:46
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Arrow

db2set db2options=-c
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health

Last edited by Tank; 07-08-04 at 08:46. Reason: syntax error
Reply With Quote
  #8 (permalink)  
Old 07-08-04, 09:03
SamCute SamCute is offline
Registered User
 
Join Date: Mar 2004
Posts: 205
Hi,

Once again thanks for your reply.

1) Can this command be executed through DB2 JDBC driver or only it could be executed from DB2 client SQL prompt ?

2) What are these commands called as ? Are they called as "SQL Plus commands"

Please advice.

Thanks,
Sam
Reply With Quote
  #9 (permalink)  
Old 07-08-04, 09:14
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Exclamation Maybe

Hi I'm not sure if these commands can be
processed through JDBC.

As far as I know, all commands beginnig with db2* are called
db2 commands and can be invoked directly from any command prompt,
as opposed to SQL statements who can only be invoked through the CLI

But I might be wrong.
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #10 (permalink)  
Old 07-08-04, 10:39
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by SamCute
Hi,

Once again thanks for your reply.

1) Can this command be executed through DB2 JDBC driver or only it could be executed from DB2 client SQL prompt ?

2) What are these commands called as ? Are they called as "SQL Plus commands"

Please advice.

Thanks,
Sam
In JDBC just do con.setAutoCommit(false)
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #11 (permalink)  
Old 02-05-12, 01:13
KAREENA KAREENA is offline
Registered User
 
Join Date: Feb 2012
Posts: 4
Quote:
Originally Posted by Tank View Post
If you want to turn it off permanently
set the variable db2options to +c (counterintuitive!)
using:

db2set db2options=+c

Look into the db2set -? for syntax.

BOW
Hi ,

I am new bie to db2, I connect to db2 as client on particular ip with the credentials that are common among team but for me there will be separate session but any how wat about if i want to set the auto commit made for my session to false that is to switch off....?? Shall I execute the same statement as other statement i do fire on tables ...!! please guide..!!
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