db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hyzer <mchy...@yahoo.com>
Subject commit after dml?
Date Wed, 30 Jul 2008 20:27:11 GMT
Hey,
When the script copies data to another table, and back, should it not commit after each step? 
The reason is if the transaction fails or is rolled back after the table ddl has occurred,
there will be data loss, right?
Thanks,
Chris
e.g.
##################   FROM:   ######################
CREATE TABLE GROUPER_ATTRIBUTES_
(
    ID VARCHAR2(128) NOT NULL,
    GROUP_ID VARCHAR2(128) NOT NULL,
    FIELD_NAME VARCHAR2(32) NOT NULL,
    VALUE VARCHAR2(1024) NOT NULL,
    hibernate_version_number NUMBER(38) DEFAULT 0,
    PRIMARY KEY (ID)
);
INSERT INTO GROUPER_ATTRIBUTES_ (ID,GROUP_ID,FIELD_NAME,VALUE,hibernate_version_number) SELECT
ID,GROUP_ID,FIELD_NAME,VALUE,hibernate_version_number FROM GROUPER_ATTRIBUTES;
DROP TABLE GROUPER_ATTRIBUTES CASCADE CONSTRAINTS;

##################  TO:  ###########################
CREATE TABLE GROUPER_ATTRIBUTES_
(
    ID VARCHAR2(128) NOT NULL,
    GROUP_ID VARCHAR2(128) NOT NULL,
    FIELD_NAME VARCHAR2(32) NOT NULL,
    VALUE VARCHAR2(1024) NOT NULL,
    hibernate_version_number NUMBER(38) DEFAULT 0,
    PRIMARY KEY (ID)
);
INSERT INTO GROUPER_ATTRIBUTES_ (ID,GROUP_ID,FIELD_NAME,VALUE,hibernate_version_number) SELECT
ID,GROUP_ID,FIELD_NAME,VALUE,hibernate_version_number FROM GROUPER_ATTRIBUTES;
COMMIT;
DROP TABLE GROUPER_ATTRIBUTES CASCADE CONSTRAINTS;



      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message