Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: set autocommit equivalent ?

    Hi,

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

    Thanks,
    Sam

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  3. #3
    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

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  5. #5
    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

  6. #6
    Join Date
    Mar 2004
    Posts
    205
    Hi,

    Thanks for your reply.

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


    Thanks,
    Sam

  7. #7
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Arrow

    db2set db2options=-c
    Last edited by Tank; 07-08-04 at 09:46. Reason: syntax error
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  8. #8
    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

  9. #9
    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

  10. #10
    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

  11. #11
    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..!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •