Autocommit DDL: difference between SQL and SQL Developer * more?

I asked this in the SQL forum (commit auto DDL: difference between developer SQL and command-line client?), but it has suggested it might be a problem in SQL Developer, so I thought I would ask here.

I'm trying to understand what exactly happens when an error occurs when a transaction is committed because of a DDL statement. I noticed that with SQL Developer, if the DDL statement CREATE TABLE, the statement is executed, even if the DML statements which I entered before CREATE TABLE violates a deferred constraint, so that the transaction fails. In SQL * Plus, it's not the case: the table is not created. I have no automatic validation. I'm using Oracle 10 g XE.

That's what happens in SQL * more:
SQL> create table table1(a number);

Table created.

SQL> alter table table1 add constraint table1_a_uq unique(a) deferrable initially deferred;

Table altered.

SQL> insert into table1 values(1);

1 row created.

SQL> commit;

Commit complete.

SQL> insert into table1 values(1);

1 row created.

SQL> create table table2(b number);
create table table2(b number)
*
ERROR at line 1:
ORA-02091: transaction rolled back
ORA-00001: unique constraint (BOEK.TABLE1_A_UQ) violated


SQL> select * from table2;
select * from table2
              *
ERROR at line 1:
ORA-00942: table or view does not exist
If I put the same code in SQL Developer (versions 1.5.5 and 2.1.0.63), the table is created.
This is my script:
create table table1(a number);
alter table table1 add constraint table1_a_uq unique(a) deferrable initially deferred;
insert into table1 values(1);
commit;
insert into table1 values(1);
create table table2(b number);
select * from table2;
And this is the output of SQL Developer:
create table succeeded.
 alter table table1 succeeded.
1 rows inserted
commited
1 rows inserted

Error starting at line 9 in command:
create table table2(b number)
Error report:
SQL Error: ORA-02091: transaction rolled back
ORA-00001: unique constraint (BOEK.TABLE1_A_UQ) violated
02091. 00000 -  "transaction rolled back"
*Cause:    Also see error 2092. If the transaction is aborted at a remote
           site then you will only see 2091; if aborted at host then you will
           see 2092 and 2091.
*Action:   Add rollback segment and retry the transaction.
B                      
---------------------- 

0 rows selected
As you can see, the table is created in SQL Developer, but not in SQL * more.

I wonder why it's different.

Well Yes, it is a slightly different situation, because you issue 1 statement that executes internally 2 statements.
But the problem is the same: the error handling. Where sqlplus rejects again (implicit) statements, sqldev goes ahead and runs them anyway. Personally, I'd say sqldev is more consistent and sqlplus is not, because run the following instructions (explicit).

Kind regards
K.

Tags: Database

Similar Questions

  • difference between SQL-2003-2008-SQL and SQL: 1999 on 9i

    What are the differences between SQL-2003 and SQL 9i or 10g?

    If I'm not mistaken:
    [http://iablog.sybase.com/paulley/2008/07/sql2008-now-an-approved-iso-international-standard/] this watch article which presents the version of sql is sql - 2008.is, he followed in GR 11, 2?

    Edited by: mango_boy Oct 6, 2009 14:21

    The reference manual of Oracle SQL language for each version of the database (which dates back at least to Oracle 7.0) has an appendix that deals with compliance with various standards.

    The SQL for GR 11, 2 language manual deals with respect to SQL 2008 in the said Appendix.

    Not surprisingly, Oracle9i was released before SQL-2008 and (as expected), there is no discussion of compliance.

    As usual, your questions can be answered by getting knowing and diving in the docs. Because it's not easy, I refer to the http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/intro.htm#i68236 documentation roadmap

    Published by: Hans Forbrich on September 6, 2009 15:38

  • Difference between oracle and Oracle Application Server Developer's costume?

    Hi all

    If someone please tell me the main difference between the costume of developer and Oracle Application Server.

    I will be very thank ful.

    Thank you

    Hina.

    You would need an application to host the application, but each user could access this application using a browser. So the obligation for each user is simply a browser with an appropriate Sun JRE installed - this JRE (if not already installed) can be configured to be automatically downloaded and installed on the client from the application server.

  • What is the difference between EPMA and Essbase Studio

    If the two are not used to design applications?

    And a really need Essbase Studio?
    What is the difference between EPMA and Essbase Studio

    ^ ^ ^ It's a little confusing, isn't? As far as I understand the role of EPMA, it is a way to share dimensions and common data between several products Oracle EMP including Planning, Essbase and HFM. In fact, I don't know if other products live in EPMA. What is EPMA not have is a great way to supply or manipulate the dimension and fact tables (or files). Oh, there are tables of the interface, but you will write the code/use the utility of dimension EPMA to load dimensions. I must say that I never tried to load through EPMA data so that someone else will have to pronounce on it. Once the dimensions are built, you can deploy Essbase (and other products) of common and specific to the database dimensions.

    Studio is the tool you will use to go against a data warehouse, or something terribly close a data warehouse to build Essbase databases. Just for Essbase - HFM, planning, etc. are not the targets of the Studio release.

    What gets confusion / intriguing, is that when EPMA deploy Essbase apps, it uses Studio under the covers to do. So the interesting implementations where people use Studio (which is much more flexible than EPMA because it is a development tool as opposed to a dimension/data management application) to read the tables, EPMA interface (and as far as I know, the EPMA base tables) and create Essbase applications like that.

    If you think that there is overlap, I agree with you, but you can see that they are not the same.

    And a really need Essbase Studio?

    ^ ^ ^ Do not use Studio to build Essbase databases. You can go hog wild in EAS with loading SQL rules if you want, even if at some point it will be probably easier and simpler to build in the Studio. Although the Studio has been mentioned as the replacement of EAS for awhile, I suspect the effort required to build a database in Studio will keep around for quite a while EAS or Studio Lite will be out. There is a lot to say (sometimes) for the incredible flexibility EAS/Essbase-Studio requires a more methodical approach and EPMA has a very formal set of standards and methods.

    Phew, I'm sorry, I wrote a book on this subject and I bet you get a lot of differences of opinion on that.

    If you are interested in the Studio, you could do well to take a copy of 'Look smarter than you are with Oracle Essbase Studio 11' of Glenn Schwartzberg. I don't get a penny from the sale while I was among the writers of copy (Hey, I got a mention in the acknowledgements). It's a good book and an excellent introduction to the tool.

    Kind regards

    Cameron Lackpour

  • Difference between Gemfire and SQLFire

    Anyone can list the differences between Gemfire and SQLFire.

    Since both are targeted and databases as an object model and another model more than SQL. Apart from this basic difference if I can get some differences and the reason behind the two products, which would be much appreciated.

    Hello
    GemFire has a slightly different set of objectives: it is designed to be much more flexible (buttons plus) designed to achieve possibly higher performance in some scenarios. For example, you can do a caching prioritized with GemFire (client applications can incorporate a local cache) and it is rich in favour of publication / subscription semantics. Thus, it is possible to realize the event in real time, more scalabe engine architecturees with GemFire more than it is with SQLFire.
      
    On the other hand, SQLFire with relational semantics is easier to understand with a query more powerful engine and support for referential integrity provided out of the box.
      
    Level positioning, GemFire could be better adapted to the 'green field' applications that lend themselves to a design of K - V and SQLFire is best suited for applications where the data model (and so mark requirements) are more complex.
  • What is the difference between varchar and varchar2

    Hello

    can someone tell me difference between varchar and varchar2

    Thank you
    Chantal

    >
    can someone tell me difference between varchar and varchar2
    >

    See VARCHAR2 and VARCHAR in the section of the doc of the SQL language data types
    >
    The VARCHAR2 data type
    The VARCHAR2 data type specifies a variable-length character string. When you create a VARCHAR2 column, you specify the maximum number of bytes or characters of data it can hold. Oracle then stores each value in the column exactly as you specify, provided that the value does not exceed the maximum length of the column. If you try to insert a value that is greater than the specified length, then Oracle returns an error.

    The VARCHAR data type
    Do not use the VARCHAR data type. Use the VARCHAR2 data type. Although the VARCHAR data type is currently synonymous with the VARCHAR2, VARCHAR data type is programmed to be redefined as a separate datatype used for character strings of variable length compared to different comparison semantics.

  • What is the difference between LEAD and LAG?

    Hi all
    Please let me know the difference between LEAD and LAG even if both are functions. Analytics, where we can use specific to improve performance.

    Thanks in advance.

    concerning
    PRAMOD

    Pramod salvation,

    pramod62917 wrote:
    Please let me know the difference between LEAD and LAG

    The main difference is in which way is 'research ':
    -Lead will "transfer" in respect of the order by clause
    -Lag goes "back" with regard to the order by clause

    See this example (Basic):

    Scott@my11g SQL>ed
    Wrote file afiedt.buf
    
      1  with t as (
      2  select 'TeamX' team, 1 player_id, 'PlayerA' name from dual
      3  union all select 'TeamX' team, 2 player_id, 'PlayerB' name from dual
      4  union all select 'TeamX' team, 3 player_id, 'PlayerC' name from dual
      5  union all select 'TeamX' team, 4 player_id, 'PlayerD' name from dual
      6  union all select 'TeamZ' team, 1 player_id, 'PlayerJ' name from dual
      7  union all select 'TeamZ' team, 2 player_id, 'PlayerK' name from dual
      8  union all select 'TeamZ' team, 3 player_id, 'PlayerL' name from dual
      9  -- end of sample data --
     10  )
     11  select
     12  team
     13  ,player_id current_play_id
     14  ,name current_name
     15  ,lead(name) over (partition by team order by player_id) next_name
     16  ,lag(name) over (partition by team order by player_id) prev_name
     17* from t
    Scott@my11g SQL>/
    
    TEAM  CURRENT_PLAY_ID CURRENT NEXT_NA PREV_NA
    ----- --------------- ------- ------- -------
    TeamX               1 PlayerA PlayerB
    TeamX               2 PlayerB PlayerC PlayerA
    TeamX               3 PlayerC PlayerD PlayerB
    TeamX               4 PlayerD         PlayerC
    TeamZ               1 PlayerJ PlayerK
    TeamZ               2 PlayerK PlayerL PlayerJ
    TeamZ               3 PlayerL         PlayerK
    
    7 rows selected.
    

    On the first line + (team = TeamX, current_play_id = 1) +, the next_name once PlayerA regarding the order given by +(order by player_id) + team +(partition by team) + playerB. For this line it is not prev_name like no player as an inferior player_id wihtin this team.
    On the 3rd line +(team=TeamX, current_play=3) +, the once next_name PlayerC in regards to the order given by the team PlayerD, the previous is PlayerB.

  • Difference between DBMS_XMLGEN and DBMS_XMLSQUERY

    Hello

    Can someone let me know the fundamental difference between DBMS_XMLGEN and DBMS_XMLQUERY?



    Thanx

    Published by: Apache on October 13, 2008 23:56

    Directly from the documentation:

    H2. DBMS_XMLGEN 125
    DBMS_XMLGEN package converts the results of a SQL query to the canonical XML format. All takes an arbitrary SQL query as input, converts it to XML format, and returns the result as a CLOB. This package is similar to the DBMS_XMLQUERY package, except that it is written in C and compiled in the kernel. This package can be run only on the database.

    H2. DBMS_XMLQUERY 127
    DBMS_XMLQUERY provides database XMLType functionality. If possible, use DBMS_XMLGEN package integrated into the C instead of DBMS_XMLQUERY.

  • What is the difference between dawn and the beta?

    What is the difference between dawn and the beta?

    Beta is the next version of Firefox that is due to be released in 5 weeks, and Aurora is the one after that--like an Alpha version of development.

  • What is the difference between OCÉ and (OCP and OCS)

    What is the difference between ECAS and (OCP or OCS).

    For example, I heard that OCS helps with the language

    and the marketing of a product.

    Could this be true as ECAS focuses on how to do things.

    and not so much things to a much higher level.

    For example, how do you set up, how you use it, how do you start, etc.

    Thank you Roger

    Roger,

    OCÉ Doghouse more. These certifications can be more CERT of intermediate or high level certificates. These were specifically developed for the gaps in the certification that did not match our OCA, OCP, hierarchy of the CMO.

    Generally, the CERT of the OCS tend to focus more on implementation. These certificates have been developed for the Oracle PartnerNetwork for areas of certification which specifically serve Oracle partners and qualify them for levels of specialization. These certifications are available for all candidates, but are directed towards members of OPN.

    I hope this helps.

    Kind regards
    Brandye Barrington

    Oracle Certification program

  • Difference between 'Reload' and "Reload (Override Cache)"?

    Https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly#w_navigation, what is the difference between 'Reload' and "Reload (Override Cache)"? What makes "ignore cache"?

    Reloading Web pages and cache bypass aims to obtain a new copy of perhaps obsolete or damaged files currently stored in the disk cache.
    You can do it like the first attempt if a normal charging does not seem to provide a version of a Web site or if you are having problems with a Web site otherwise.

    We usually have advice that if you have questions:

    Reload Web pages and ignore the cache to refresh potentially stale or corrupt.

    • Hold down the SHIFT key and click the Reload button
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Command + shift + R' (Mac)

    Clear the cache and delete cookies only from Web sites that cause problems.
    "Clear the Cache":

    • Firefox/tools > Options > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox/tools > Options > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".

    Start Firefox in Safe Mode to check if an extension or theme (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problems.

  • is there a difference between 38 and 42mm with their pixel density?

    is there a difference between 38 and 42mm with their pixel density? the 38mm and 42mm watches have same interns?

    You can see the technical details of the Apple Watch here. Apple - Support - technical specifications

  • What is the difference between extensions and Plugins and Add-ons?

    I'm sorry if here is not the right place for this post.

    What is the difference between extensions and Plugins and Add-ons? Apparantely, they differ in some sense or aspect, but I do not know how. Please, if it is not too complicated, explain in detail and simple language. Thanks in advance to 1 million.

    Kind regards
    Danesh

    Hi Danesh,

    You should take a look at this article for an explanation. Plugins and extensions are essentially types of Add-ons as well as of the characters and themes.

    Hope this helps!

  • What is the difference between Firefox and Namoroka 64-bit? I have a 64-bit computer. Which should I use?

    What is the difference between Firefox and Namoroka 64-bit?
    I have a 64-bit computer. Which should I use?

    The officially supported only is Firefox - which is your best choice, unless you want to test the new features...

    http://www.Mozilla.org/en-us/Firefox/new/

  • Difference between valuation and putting in good shape?

    What is the difference between recovery and formatting?

    I need to download tools and utilities to perform the recovery?

    Recovery recovery image installation.
    Formatting of removal of content from disk HARD integer.

    No, you don't need any download. All you need is CD/DVD recovery for your laptop model.

    To be honest, your questions are a bit funny. If you want to have accurate on such things information please publish your laptop model and it will be much easier to give you exact explanation and instructions how to use recovery CD/DVDs.

Maybe you are looking for