ALTER Transactions

  • Comments posted to this topic are about the item ALTER Transactions

  • Nice, easy one today, thanks Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Stewart "Arturius" Campbell - Wednesday, July 18, 2018 11:40 PM

    Nice, easy one today, thanks Steve

    Not easy for those with an Oracle background who may well get this wrong.

  • paul s-306273 - Thursday, July 19, 2018 2:18 AM

    Stewart "Arturius" Campbell - Wednesday, July 18, 2018 11:40 PM

    Nice, easy one today, thanks Steve

    Not easy for those with an Oracle background who may well get this wrong.

    True...
    Forgot about that. haven't worked with Oracle in many years...

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • paul s-306273 - Thursday, July 19, 2018 2:18 AM

    Stewart "Arturius" Campbell - Wednesday, July 18, 2018 11:40 PM

    Nice, easy one today, thanks Steve

    Not easy for those with an Oracle background who may well get this wrong.

    I can barely spell Oracle. I have worked with it but never for more than a few weeks at a time. What is different about Oracle in this situation?

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Stewart "Arturius" Campbell - Wednesday, July 18, 2018 11:40 PM

    Nice, easy one today, thanks Steve

    Almost too easy. I was looking and looking for the catch and finally decided it was as straight forward as I thought. 😀

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange - Thursday, July 19, 2018 7:11 AM

    paul s-306273 - Thursday, July 19, 2018 2:18 AM

    Stewart "Arturius" Campbell - Wednesday, July 18, 2018 11:40 PM

    Nice, easy one today, thanks Steve

    Not easy for those with an Oracle background who may well get this wrong.

    I can barely spell Oracle. I have worked with it but never for more than a few weeks at a time. What is different about Oracle in this situation?

    Hi - there is an autocommit on DDL in Oracle.

  • paul s-306273 - Thursday, July 19, 2018 7:24 AM

    Sean Lange - Thursday, July 19, 2018 7:11 AM

    paul s-306273 - Thursday, July 19, 2018 2:18 AM

    Stewart "Arturius" Campbell - Wednesday, July 18, 2018 11:40 PM

    Nice, easy one today, thanks Steve

    Not easy for those with an Oracle background who may well get this wrong.

    I can barely spell Oracle. I have worked with it but never for more than a few weeks at a time. What is different about Oracle in this situation?

    Hi - there is an autocommit on DDL in Oracle.

    Ahhh interesting.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Elementary, dear Watson. Thanks, Steve!

  • paul s-306273 - Thursday, July 19, 2018 7:24 AM

    Sean Lange - Thursday, July 19, 2018 7:11 AM

    paul s-306273 - Thursday, July 19, 2018 2:18 AM

    Stewart "Arturius" Campbell - Wednesday, July 18, 2018 11:40 PM

    Nice, easy one today, thanks Steve

    Not easy for those with an Oracle background who may well get this wrong.

    I can barely spell Oracle. I have worked with it but never for more than a few weeks at a time. What is different about Oracle in this situation?

    Hi - there is an autocommit on DDL in Oracle.

    Does that override an explicit transaction?  That is what we have here.

  • Nice Question, Thanks

    ---------------------------------------------------------------------------------------
    The more you know, the more you know that you dont know

  • Lynn Pettis - Thursday, July 19, 2018 3:34 PM

    Does that override an explicit transaction?  That is what we have here.

    Hi Lynn, yes that will override the explicit transaction:

    A transaction ends when it is committed or rolled back, either explicitly with a COMMIT or ROLLBACK statement or implicitly when a DDL statement is issued.

  • paul s-306273 - Monday, July 23, 2018 2:53 AM

    Hi Lynn, yes that will override the explicit transaction:

    A transaction ends when it is committed or rolled back, either explicitly with a COMMIT or ROLLBACK statement or implicitly when a DDL statement is issued.

    Well that seems really silly. The auto commit is only for ddl? Meaning that ddl ignores explicit transactions in oracle? Seems like that is an interesting choice from the designers.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange - Monday, July 23, 2018 7:42 AM

    Well that seems really silly. The auto commit is only for ddl? Meaning that ddl ignores explicit transactions in oracle? Seems like that is an interesting choice from the designers.

    Use Autonomous Transactions to execute the DDL.

  • Lynn Pettis - Monday, July 23, 2018 10:55 AM

    Use Autonomous Transactions to execute the DDL.

    However, as Tom Kyte said when talking about misused features in Oracle:    

  • "The third issue is the autonomous transaction which allows people to do things such as commit in a trigger because they can do that in SQL Server. 
  • SQL Server triggers work differently than Oracle triggers and, committing in a trigger is a horribly bad idea. I believe it’s horribly bad in SQL Server, but it’s doubly horribly bad in Oracle.

    Many people inappropriately use an autonomous transaction all over the place to get around what they think are limitations, but when I look at that code and I explain to them what’s going on they don’t even realise the transactional integrity issues that they’ve introduced into their application.

    You know if you commit in a trigger that means you commit that work. But they don’t realize it only commits the work that was done in the trigger, not the statement that caused the trigger to fire. Think about what happens then when the user rolls back? The stuff you did in your trigger doesn’t roll back with you, it’s non-transactional, you’ve already committed it and now the database is sort of left in this inconsistent state. "

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic. Login to reply