Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" size="32" type="varchar"/> name="col3" size="15" type="decimal"/> name="col4" precision="3" size="15" type="decimal"/> name="col5" type="date"/> default="2" name="col6" type="int"/> default="1.234" name="col7" type="float"/> |
DBMS: postgres, postgres7, oracle, firebird |
---|
CREATE TABLE table1 ( col1 integer, col2 varchar(32), col3 decimal(15), col4 decimal(15, 3), col5 date, col6 int DEFAULT 2, col7 float DEFAULT 1.234 ); |
DBMS: mysql,mysql4 |
---|
CREATE TABLE table1 ( col1 integer, col2 varchar(32), col3 decimal(15), col4 decimal(15, 3), col5 date, col6 int DEFAULT 2, col7 float DEFAULT 1.234 ) TYPE=InnoDB; |
Before | After |
---|---|
name="Table with spaces"> name="column with spaces" type="int"/> name="select" type="int"/> columns="column with spaces,select" name="from"/> |
DBMS: postgres, postgres7, oracle, firebird |
---|
CREATE TABLE "Table with spaces" ( "column with spaces" int, "select" int ); |
CREATE INDEX "from" ON "Table with spaces" ("column with spaces", "select"); |
DBMS: mysql,mysql4 |
---|
CREATE TABLE `Table with spaces` ( `column with spaces` int, `select` int ) TYPE=InnoDB; |
CREATE INDEX `from` ON `Table with spaces` (`column with spaces`, `select`); |
Before | After |
---|---|
name="column"> class="mytype" type="integer"/> name="table1"> class="mytype" name="col1"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, oracle, mysql, mysql4, firebird |
---|
DROP TABLE table1; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="table1"> name="col1" size="10" type="decimal"/> name="col2" type="integer"/> |
DBMS: postgres, firebird |
---|
ALTER TABLE table1 ALTER col1 TYPE decimal(10); |
DBMS: postgres7 |
---|
ALTER TABLE table1 ADD tmp_col1 decimal(10); |
UPDATE table1 SET tmp_col1 = col1; |
ALTER TABLE table1 DROP col1; |
ALTER TABLE table1 RENAME tmp_col1 TO col1; |
DBMS: mysql,mysql4,oracle |
---|
ALTER TABLE table1 MODIFY col1 decimal(10); |
Before | After |
---|---|
name="table1"> name="col1" size="15" type="decimal"/> name="col2" type="integer"/> |
name="table1"> name="col1" size="10" type="decimal"/> name="col2" type="integer"/> |
DBMS: postgres, firebird |
---|
ALTER TABLE table1 ALTER col1 TYPE decimal(10); |
DBMS: postgres7 |
---|
ALTER TABLE table1 ADD tmp_col1 decimal(10); |
UPDATE table1 SET tmp_col1 = col1; |
ALTER TABLE table1 DROP col1; |
ALTER TABLE table1 RENAME tmp_col1 TO col1; |
DBMS: mysql,mysql4,oracle |
---|
ALTER TABLE table1 MODIFY col1 decimal(10); |
Before | After |
---|---|
name="table1"> default="0" name="col1" size="15" type="decimal"/> name="col2" type="integer"/> |
name="table1"> default="2" name="col1" size="15" type="decimal"/> default="3" name="col2" type="integer"/> |
DBMS: postgres, postgres7, mysql, mysql4 |
---|
ALTER TABLE table1 ALTER col1 SET DEFAULT 2; |
ALTER TABLE table1 ALTER col2 SET DEFAULT 3; |
DBMS: oracle |
---|
ALTER TABLE table1 MODIFY col1 decimal(15) DEFAULT 2; |
ALTER TABLE table1 MODIFY col2 integer DEFAULT 3; |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table1 ALTER col1 TYPE decimal(15) SET DEFAULT 2; |
ALTER TABLE table1 ALTER col2 TYPE integer SET DEFAULT 3; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="table1"> name="col1" type="integer"/> name="col_newname" oldname="col2" type="integer"/> |
DBMS: postgres, postgres7 |
---|
ALTER TABLE table1 RENAME col2 TO col_newname; |
DBMS: oracle |
---|
ALTER TABLE table1 RENAME COLUMN col2 TO col_newname; |
DBMS: mysql,mysql4 |
---|
ALTER TABLE table1 CHANGE col2 col_newname integer; |
DBMS: firebird |
---|
ALTER TABLE table1 ALTER col2 TO col_newname; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="table1"> name="col1" type="integer"/> name="col-newname" oldname="col2" size="80" type="varchar"/> |
DBMS: postgres |
---|
ALTER TABLE table1 ALTER col2 TYPE varchar(80); |
ALTER TABLE table1 RENAME col2 TO "col-newname"; |
DBMS: postgres7 |
---|
ALTER TABLE table1 ADD tmp_col2 varchar(80); |
UPDATE table1 SET tmp_col2 = col2; |
ALTER TABLE table1 DROP col2; |
ALTER TABLE table1 RENAME tmp_col2 TO col2; |
ALTER TABLE table1 RENAME col2 TO "col-newname"; |
DBMS: mysql,mysql4 |
---|
ALTER TABLE table1 MODIFY col2 varchar(80); |
ALTER TABLE table1 CHANGE col2 `col-newname` varchar(80); |
DBMS: oracle |
---|
ALTER TABLE table1 MODIFY col2 varchar(80); |
ALTER TABLE table1 RENAME COLUMN col2 TO "col-newname"; |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table1 ALTER col2 TO col-newname; |
ALTER TABLE table1 ALTER col-newname TYPE varchar(80); |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> default="1" name="col2" type="integer"/> |
name="table1"> default="2" name="col1" size="10" type="decimal"/> default="3" name="col2" size="15" type="decimal"/> |
DBMS: postgres |
---|
ALTER TABLE table1 ALTER col1 TYPE decimal(10); |
ALTER TABLE table1 ALTER col2 TYPE decimal(15); |
ALTER TABLE table1 ALTER col1 SET DEFAULT 2; |
ALTER TABLE table1 ALTER col2 SET DEFAULT 3; |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table1 ALTER col1 TYPE decimal(10); |
ALTER TABLE table1 ALTER col2 TYPE decimal(15); |
ALTER TABLE table1 ALTER col1 SET DEFAULT 2; |
ALTER TABLE table1 ALTER col2 SET DEFAULT 3; |
DBMS: mysql,mysql4 |
---|
ALTER TABLE table1 MODIFY col1 decimal(10); |
ALTER TABLE table1 MODIFY col2 decimal(15); |
ALTER TABLE table1 ALTER col1 SET DEFAULT 2; |
ALTER TABLE table1 ALTER col2 SET DEFAULT 3; |
DBMS: oracle |
---|
ALTER TABLE table1 MODIFY col1 decimal(10); |
ALTER TABLE table1 MODIFY col2 decimal(15); |
ALTER TABLE table1 MODIFY col1 decimal(10) DEFAULT 2; |
ALTER TABLE table1 MODIFY col2 decimal(15) DEFAULT 3; |
DBMS: postgres7 |
---|
ALTER TABLE table1 ADD tmp_col1 decimal(10); |
UPDATE table1 SET tmp_col1 = col1; |
ALTER TABLE table1 DROP col1; |
ALTER TABLE table1 RENAME tmp_col1 TO col1; |
ALTER TABLE table1 ADD tmp_col2 decimal(15); |
UPDATE table1 SET tmp_col2 = col2; |
ALTER TABLE table1 DROP col2; |
ALTER TABLE table1 RENAME tmp_col2 TO col2; |
ALTER TABLE table1 ALTER col1 SET DEFAULT 2; |
ALTER TABLE table1 ALTER col2 SET DEFAULT 3; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="table1"> name="col2" type="integer"/> |
DBMS: postgres, postgres7, mysql, mysql4, firebird |
---|
ALTER TABLE table1 DROP col1; |
DBMS: oracle |
---|
ALTER TABLE table1 DROP COLUMN col1; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="table1"> name="col1" type="integer"/> |
DBMS: postgres, postgres7, mysql, mysql4, firebird |
---|
ALTER TABLE table1 DROP col2; |
DBMS: oracle |
---|
ALTER TABLE table1 DROP COLUMN col2; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="new_table_name" oldname="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, oracle, mysql, mysql4 |
---|
ALTER TABLE table1 RENAME TO new_table_name; |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table1 RENAME TO new_table_name; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
desc="François's table" name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, oracle |
---|
COMMENT ON TABLE table1 IS 'François''s table'; |
DBMS: mysql,mysql4 Warning: Fails |
---|
Note: Can't change a comment on a mysql table, would require recreating table from scratch. If anyone knows otherwise, please let me know. |
DBMS: firebird |
---|
UPDATE RDB$RELATIONS SET RDB$DESCRIPTION = 'François''s table' WHERE RDB$RELATION_NAME = upper('table1'); |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="table1"> desc="François's column" name="col1" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, oracle |
---|
COMMENT ON COLUMN table1.col1 IS 'François''s column'; |
DBMS: mysql,mysql4 |
---|
ALTER TABLE table1 MODIFY col1 integer COMMENT 'François''s column'; |
DBMS: firebird |
---|
UPDATE RDB$RELATION_FIELDS SET RDB$DESCRIPTION = 'François''s column' WHERE RDB$RELATION_NAME = upper('table1') AND RDB$FIELD_NAME = upper('col1'); |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1"/> columns="col1,col2" name="col1col2"/> |
DBMS: postgres, postgres7, oracle, mysql, mysql4, firebird |
---|
CREATE INDEX idx_table1col1 ON table1 (col1); |
CREATE INDEX col1col2 ON table1 (col1, col2); |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1"/> columns="col1,col2" name="col1col2"/> |
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, oracle, firebird |
---|
DROP INDEX idx_table1col1; |
DROP INDEX col1col2; |
DBMS: mysql,mysql4 |
---|
DROP INDEX idx_table1col1 ON table1; |
DROP INDEX col1col2 ON table1; |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1" name="table1Col1"/> columns="col1,col2" name="col1col2"/> |
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1" name="rename1" oldname="table1Col1"/> columns="col1,col2" name="rename2" oldname="col1col2"/> |
DBMS: postgres, postgres7, oracle, firebird |
---|
DROP INDEX table1Col1; |
DROP INDEX col1col2; |
CREATE INDEX rename1 ON table1 (col1); |
CREATE INDEX rename2 ON table1 (col1, col2); |
DBMS: mysql,mysql4 |
---|
DROP INDEX table1Col1 ON table1; |
DROP INDEX col1col2 ON table1; |
CREATE INDEX rename1 ON table1 (col1); |
CREATE INDEX rename2 ON table1 (col1, col2); |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1"/> columns="col1,col2" name="col1col2"/> |
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1" name="rename1" oldname="table1Col1"/> columns="col1,col2" name="rename2" oldname="col1col2"/> |
DBMS: postgres, postgres7, oracle, firebird |
---|
DROP INDEX col1col2; |
DROP INDEX idx_table1col1; |
CREATE INDEX rename1 ON table1 (col1); |
CREATE INDEX rename2 ON table1 (col1, col2); |
DBMS: mysql,mysql4 |
---|
DROP INDEX col1col2 ON table1; |
DROP INDEX idx_table1col1 ON table1; |
CREATE INDEX rename1 ON table1 (col1); |
CREATE INDEX rename2 ON table1 (col1, col2); |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1" name="table1cCol1"/> columns="col1,col2" name="col1col2"/> |
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col2" name="table1Col1"/> columns="col2,col1" name="col1col2"/> |
DBMS: postgres, postgres7, oracle, firebird |
---|
DROP INDEX col1col2; |
DROP INDEX table1cCol1; |
CREATE INDEX table1Col1 ON table1 (col2); |
CREATE INDEX col1col2 ON table1 (col2, col1); |
DBMS: mysql,mysql4 |
---|
DROP INDEX col1col2 ON table1; |
DROP INDEX table1cCol1 ON table1; |
CREATE INDEX table1Col1 ON table1 (col2); |
CREATE INDEX col1col2 ON table1 (col2, col1); |
Before | After |
---|---|
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col1"/> columns="col1,col2" name="col1col2"/> |
name="table1"> name="col1" type="integer"/> name="col2" type="integer"/> columns="col2" name="table1Col1"/> columns="col2,col1" name="col1col2"/> |
DBMS: postgres, postgres7, oracle, mysql, mysql4, firebird Warning: Fails |
---|
DROP INDEX table1Col1; |
CREATE INDEX table1Col1 ON table1 (col2); |
DROP INDEX col1col2; |
CREATE INDEX col1col2 ON table1 (col2, col1); |
Before | After |
---|---|
<!-- Until I get dropping of tables with constraints done in the Right order, table2 needs to be first --> name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> name="table1"> default="0" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> <!-- MySQL addes this automatically --> columns="table1_id" name="fk_table1_id"/> column="table1_id" table="table1"/> name="table1"> default="0" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, oracle, mysql, mysql4 |
---|
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id); |
CREATE INDEX fk_table1_id ON table2 (table1_id); |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id); |
Before | After |
---|---|
<!-- FIX: Broken if the tables are in the wrong order, need to find the dependancy list and try to build in the right order --> name="table1"> key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> column="table1_id" table="table1"/> |
name="table1"> key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> |
DBMS: postgres, postgres7, oracle |
---|
ALTER TABLE table2 DROP CONSTRAINT fk_table1_id; |
DBMS: mysql,mysql4 |
---|
Note: This doesn't pass the test because mysql drops the default as well |
ALTER TABLE table2 DROP CONSTRAINT fk_table1_id; |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table2 DROP CONSTRAINT fk_table1_id; |
Before | After |
---|---|
name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> name="table1"> default="0" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> <!-- MySQL silently adds this --> columns="table1_id" name="fk_table1_id"/> column="table1_id" fk="table1_id" name="fk_table1_id" ondelete="cascade" onupdate="cascade" table="table1"/> name="table1"> default="0" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, mysql, mysql4 |
---|
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id) ON DELETE CASCADE ON UPDATE CASCADE; |
CREATE INDEX fk_table1_id ON table2 (table1_id); |
DBMS: oracle |
---|
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id) ON DELETE CASCADE; |
CREATE INDEX fk_table1_id ON table2 (table1_id); |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id); |
Before | After |
---|---|
<!-- Fix: if the tables are in the wrong order it fails --> name="table1"> default="0" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> column="table1_id" fk="table1_id" name="fk_table1_id" ondelete="cascade" onupdate="cascade" table="table1"/> |
name="table2"> name="table2_id" type="integer"/> name="table1_id" type="integer"/> column="table1_id" fk="table1_id" name="fk_table1_id" ondelete="setnull" onupdate="setnull" table="table1"/> name="table1"> default="0" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7 |
---|
ALTER TABLE table2 DROP CONSTRAINT fk_table1_id; |
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id) ON DELETE SET NULL ON UPDATE SET NULL; |
DBMS: oracle |
---|
ALTER TABLE table2 DROP CONSTRAINT fk_table1_id; |
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id) ON DELETE SET NULL; |
DBMS: mysql,mysql4 Warning: Fails |
---|
ALTER TABLE table2 DROP CONSTRAINT fk_table1_id; |
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id) ON DELETE SET NULL ON UPDATE SET NULL; |
DBMS: firebird Warning: Fails |
---|
ALTER TABLE table2 DROP CONSTRAINT fk_table1_id; |
ALTER TABLE table2 ADD CONSTRAINT fk_table1_id FOREIGN KEY (table1_id) REFERENCES table1(table1_id) ON DELETE SET NULL ON UPDATE SET NULL; |
Before | After |
---|---|
name="table1"> autoincrement="yes" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres,postgres7 |
---|
CREATE SEQUENCE table1_table1_id_seq; |
CREATE TABLE table1 ( table1_id integer NOT NULL DEFAULT nextval('table1_table1_id_seq'), col2 integer, CONSTRAINT pk_table1 PRIMARY KEY (table1_id)); |
DBMS: mysql,mysql4 |
---|
CREATE TABLE table1 ( table1_id integer NOT NULL AUTO_INCREMENT, col2 integer, CONSTRAINT pk_table1 PRIMARY KEY (table1_id)) TYPE=InnoDB; |
DBMS: oracle Warning: Fails |
---|
CREATE SEQUENCE table1_table1_id_seq; |
CREATE TABLE table1 ( table1_id integer NOT NULL, col2 integer, CONSTRAINT pk_table1 PRIMARY KEY (table1_id)); |
CREATE TRIGGER ai_table1_table1_id FOR table1 BEFORE INSERT AS BEGIN IF (:NEW.table1_id IS NULL) THEN SELECT table1_table1_id_seq.NEXTVAL INTO :NEW.table1_id FROM DUAL; END IF; END; |
DBMS: firebird |
---|
CREATE GENERATOR table1_table1_id_seq; |
CREATE TABLE table1 ( table1_id integer NOT NULL, col2 integer, CONSTRAINT pk_table1 PRIMARY KEY (table1_id)); |
CREATE TRIGGER ai_table1_table1_id FOR table1 BEFORE INSERT AS BEGIN NEW.table1_id = GEN_ID(table1_table1_id_seq, 1); END; |
Before | After |
---|---|
name="table1"> autoincrement="yes" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
name="table1"> <!-- Added the default="0" to work best with MySQL --> key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres,postgres7 |
---|
ALTER TABLE table1 ALTER table1_id DROP DEFAULT; |
DROP SEQUENCE table1_table1_id_seq; |
DBMS: mysql |
---|
ALTER TABLE table1 MODIFY table1_id integer NOT NULL; |
DBMS: mysql4 Warning: Fails |
---|
ALTER TABLE table1 ALTER table1_id DROP DEFAULT; |
DROP SEQUENCE table1_table1_id_seq; |
DBMS: oracle Warning: Fails |
---|
DROP TRIGGER ai_table1_table1_id; |
DROP SEQUENCE table1_table1_id_seq; |
DBMS: firebird Warning: Fails |
---|
Before | After |
---|---|
name="table1"> autoincrement="yes" key="1" name="table1_id" null="no" type="integer"/> name="col2" type="integer"/> |
DBMS: mysql, mysql4 |
---|
DROP TABLE table1; |
DBMS: postgres,postgres7 |
---|
ALTER TABLE table1 ALTER table1_id DROP DEFAULT; |
ALTER TABLE table1 DROP CONSTRAINT pk_table1; |
DROP TABLE table1; |
DROP SEQUENCE table1_table1_id_seq; |
DBMS: oracle Warning: Fails |
---|
DROP SEQUENCE table1_table1_id_seq; |
DROP TRIGGER ai_table1_table1_id; |
ALTER TABLE table1 DROP CONSTRAINT pk_table1; |
DROP TABLE table1; |
DBMS: firebird |
---|
ALTER TABLE table1 DROP CONSTRAINT pk_table1; |
DROP TRIGGER ai_table1_table1_id; |
DROP TABLE table1; |
DROP GENERATOR table1_table1_id_seq; |
Before | After |
---|---|
name="table1"> name="id" type="integer"/> name="col2" type="integer"/> |
name="table1"> name="id" type="integer"/> name="col2" type="integer"/> name="myview"> SELECT table1.id, table1.col2 FROM table1 |
DBMS: postgres, postgres7, oracle, mysql, firebird |
---|
CREATE VIEW myview AS SELECT table1.id, table1.col2 FROM table1; |
DBMS: mysql4 Warning: Fails |
---|
Before | After |
---|---|
name="table1"> name="id" type="integer"/> name="col2" type="integer"/> name="myview"> SELECT table1.id, table1.col2 FROM table1 |
DBMS: postgres, postgres7, oracle, mysql, firebird |
---|
DROP VIEW myview; |
DROP TABLE table1; |
DBMS: mysql4 Warning: Fails |
---|
Before | After |
---|---|
name="table1"> name="id" type="integer"/> name="col2" type="integer"/> name="myview"> SELECT table1.id, table1.col2 FROM table1 |
name="table1"> name="id" type="integer"/> name="col2" type="integer"/> |
DBMS: postgres, postgres7, oracle, mysql, firebird |
---|
DROP VIEW myview; |
DBMS: mysql4 Warning: Fails |
---|
Before | After |
---|---|
name="table1"> name="id" type="integer"/> name="col2" type="integer"/> name="myview"> SELECT table1.id, table1.col2 FROM table1 |
name="table1"> name="id" type="integer"/> name="col2" type="integer"/> name="newview" oldname="myview"> SELECT table1.id, table1.col2 FROM table1 |
DBMS: postgres, postgres7, oracle, firebird |
---|
DROP VIEW myview; |
CREATE VIEW newview AS SELECT table1.id, table1.col2 FROM table1; |
DBMS: mysql4 Warning: Fails |
---|
DBMS: mysql |
---|
Before | After |
---|---|
arguments="subtotal float" dbms="firebird" name="myfunc" returns="float"> BEGIN ret = subtotal * 0.06; END arguments="subtotal float" dbms="postgres,mysql,oracle" name="myfunc" returns="float"> BEGIN RETURN subtotal * 0.06; END |
DBMS: postgres |
---|
CREATE FUNCTION myfunc(subtotal float) RETURNS float AS ' BEGIN RETURN subtotal * 0.06; END' LANGUAGE plpgsql; |
DBMS: postgres7 |
---|
CREATE FUNCTION myfunc(float) RETURNS float AS ' DECLARE subtotal ALIAS FOR $1; BEGIN RETURN subtotal * 0.06; END' LANGUAGE plpgsql; |
DBMS: mysql |
---|
CREATE FUNCTION myfunc(subtotal float) RETURNS float BEGIN RETURN subtotal * 0.06; END; |
DBMS: firebird |
---|
CREATE PROCEDURE myfunc(subtotal float) RETURNS (ret float) AS BEGIN ret = subtotal * 0.06; END;; |
DBMS: oracle |
---|
CREATE FUNCTION myfunc(subtotal IN float) RETURN float AS BEGIN RETURN subtotal * 0.06; END;; |
Before | After |
---|---|
arguments="subtotal float" dbms="firebird" name="myfunc" returns="float"> BEGIN ret = subtotal * 0.06; END arguments="subtotal float" dbms="postgres,mysql,oracle" name="myfunc" returns="float"> BEGIN RETURN subtotal * 0.06; END; |
DBMS: postgres,postgres7 |
---|
DROP FUNCTION myfunc(float); |
DBMS: mysql |
---|
DROP FUNCTION myfunc; |
DBMS: firebird |
---|
DROP PROCEDURE myfunc; |
Before | After |
---|---|
arguments="subtotal float" dbms="postgres,mysql,oracle" name="myfunc" returns="float"> BEGIN RETURN subtotal * 0.06; END arguments="subtotal float" dbms="firebird" name="myfunc" returns="float"> BEGIN ret = subtotal * 0.06; END |
arguments="subtotal float" dbms="postgres,mysql,oracle" name="myfunc" returns="float"> BEGIN RETURN subtotal * 0.07; END arguments="subtotal float" dbms="firebird" name="myfunc" returns="float"> BEGIN ret = subtotal * 0.07; END |
DBMS: postgres |
---|
DROP FUNCTION myfunc(float); |
CREATE FUNCTION myfunc(subtotal float) RETURNS float AS ' BEGIN RETURN subtotal * 0.07; END' LANGUAGE plpgsql; |
DBMS: postgres7 |
---|
DROP FUNCTION myfunc(float); |
CREATE FUNCTION myfunc(subtotal float) RETURNS float AS ' BEGIN RETURN subtotal * 0.07; END' LANGUAGE plpgsql; |
DBMS: mysql |
---|
DROP FUNCTION myfunc; |
CREATE FUNCTION myfunc(subtotal float) RETURNS float BEGIN RETURN subtotal * 0.07; END; |
DBMS: firebird |
---|
DROP PROCEDURE myfunc; |
CREATE PROCEDURE myfunc(subtotal float) RETURNS (ret float) AS BEGIN ret = subtotal * 0.07; END;; |
Before | After |
---|---|
arguments="subtotal float" dbms="postgres,mysql,oracle" name="newfunc" oldname="myfunc" returns="float"> BEGIN RETURN subtotal * 0.06; END arguments="subtotal float" dbms="firebird" name="newfunc" oldname="myfunc" returns="float"> BEGIN ret = subtotal * 0.06; END |
arguments="subtotal float" dbms="postgres,mysql,oracle" name="newfunc" oldname="myfunc" returns="float"> BEGIN RETURN subtotal * 0.06; END arguments="subtotal float" dbms="firebird" name="newfunc" oldname="myfunc" returns="float"> BEGIN ret = subtotal * 0.06; END |
DBMS: postgres,postgres7 |
---|
DROP FUNCTION myfunc(float); |
CREATE FUNCTION newfunc(float) RETURNS float AS ' DECLARE subtotal ALIAS FOR $1; BEGIN RETURN subtotal * 0.06; END' LANGUAGE plpgsql; |
DBMS: mysql |
---|
DROP FUNCTION myfunc; |
CREATE FUNCTION newfunc(subtotal float) RETURNS float BEGIN RETURN subtotal * 0.06; END; |
DBMS: firebird |
---|
DROP PROCEDURE myfunc; |
CREATE PROCEDURE newfunc(subtotal float) RETURNS (ret float) AS BEGIN RETURN subtotal * 0.06; END;; |
Before | After |
---|---|
name="column"> class="mytype" type="integer"/> abbr="t" name="table1"> class="mytype" name="col1"/> name="col2" type="integer"/> name="col3" size="32" type="varchar"/> name="col4" size="15" type="decimal"/> name="col5" precision="3" size="15" type="decimal"/> name="col6" type="date"/> <!-- name="col7" type="timestamp"/> This one causing problems with mysql --> default="2" name="col8" type="int"/> default="1.234" name="col9" type="float"/> |
DBMS: oracle,postgres,postgres7,firebird |
---|
CREATE TABLE table1 ( t_col1 integer, t_col2 integer, t_col3 varchar(32), t_col4 decimal(15), t_col5 decimal(15, 3), t_col6 date, t_col8 int DEFAULT 2, t_col9 float DEFAULT 1.234 ); |
DBMS: mysql,mysql4 |
---|
CREATE TABLE table1 ( t_col1 integer, t_col2 integer, t_col3 varchar(32), t_col4 decimal(15), t_col5 decimal(15, 3), t_col6 date, t_col8 int DEFAULT 2, t_col9 float DEFAULT 1.234 ) TYPE=InnoDB; |