• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Rolling back Oracle DDL

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please can someone tell me if there is a way to rollback oracle 9i DDL statements using JDBC.

I am creating a table and I wish to roll back the creation if any exception occurs. I have found that oracle is not letting you do this.

any ideas?
 
author
Posts: 4223
33
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Off hand I don't think you can. I recall working with oracle recently and noticing table creation was immediate.

One question that stands out is why would you ever want to randomly create tables? Most applications run with fixed table structures with the exception of upgraders/installers. I can only hope the table creation isn't happening all the time or you can easily end up with unmanageable table sets. Please describe why you are creating tables on the fly and we might be able to help you try another technique.
 
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always write a drop table command to rollback the create.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The DDL command is not support transaction,therefore you can't rollback the DDL command.
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle does an implicit commit before and after each DDL statement, so no you can't rollback.
 
Gobind Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thanks to all for replying. I now understand that it is a limitation of oracle. (The reason I was trying to roll back DDL is because I am working with a Java program which runs reports. In order for this program to run a report, it creates lots of temporary tables on the fly in order to calculate metrics.) I wanted to roll these back.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be of interest to you

Ask Tom about Temporary Tables
 
Men call me Jim. Women look past me to this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic