This portal is to open public enhancement requests against products and services offered by the IBM Data & AI organization. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
Shape the future of IBM!
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Search existing ideas
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post your ideas
Post ideas and requests to enhance a product or service. Take a look at ideas others have posted and upvote them if they matter to you,
Post an idea
Upvote ideas that matter most to you
Get feedback from the IBM team to refine your idea
Specific links you will want to bookmark for future use
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
IBM Employees should enter Ideas at https://ideas.ibm.com
See this idea on ideas.ibm.com
Why is it useful?
When complex changes are made in DDL and one of the changes fails, it can get pretty hard to revert the issue.
Who would benefit from it?
Implementing this idea would tremendously help database administrators.
How should it work?
Sample in Db2 v11.5.8.0
db2 "create schema user1"
db2 "create table user1.tab1 (col1 int, col2 int)"
# SQL changes are transactional (works fine)
db2 -td@ "begin insert into user1.tab1 values (1, 1); update user1.tab1 set col1 =2; end@"
# DDL changes are not transactional (DOES NOT WORK - MY IDEA, IMPLEMENT THIS)
db2 -td@ "begin alter table user1.tab1 drop column col2; alter table user1.tab1 add column col2 char(1); end@"
# Above command returns error:
# SQL0104N An unexpected token "alter" was found following "begin ". Expected
# tokens may include: "TRUNCATE". LINE NUMBER=1. SQLSTATE=42601
# But splitting above command into two commands works fine, but they are not transactional.
# If second command fails, first command is not rollbacked.
db2 "alter table user1.tab1 drop column col2"
db2 "alter table user1.tab1 add column col2 char(1)"
Now compare the same to PostgreSQL 15.4 database
psql -c "create schema user1"
psql -c "create table user1.tab1 (col1 int, col2 int)"
# SQL changes are transactional (works fine)
psql -c "begin; insert into user1.tab1 values (1, 1); update user1.tab1 set col1 =2; end"
# DDL changes are also transaction (also works fine!!!)
psql -c "begin; alter table user1.tab1 drop column col2; alter table user1.tab1 add column col2 char(1); end"
# In above command, if "add column" fails, "drop column" is ALSO reverted (rollbacked).
Needed By | Quarter |
By clicking the "Post Comment" or "Submit Idea" button, you are agreeing to the IBM Ideas Portal Terms of Use.
Do not place IBM confidential, company confidential, or personal information into any field.
@Ned, I tried your idea on Db2 v11.5.8.0 on Linux and Windows and the same result.
But this doesn't work (last select should not be successful). The same issue on Linux and Windows.
Now only testing "update command options" command:
And Auto-commit does not changes the setting. Did I perform something wrong or is this a bug?
Thank you for submitting this Idea! Upon review, the DDL is under transaction control as demonstrated by this example:
Note that autocommit is enabled by default in the Db2 CLP. With autocommit enabled, the CLP issues a commit after each statement. The example above disables autocommit, alteratively, it can be disabled via the +c CLP option