Hello

I just started looking at ddlutils, but encountered a small bug with 
firebird (and interbase as they are almost the same), when you drop a 
column the correct interbase syntax is
ALTER TABLE tbl DROP col
and do not accept a COLUMN keyword here.

I provide a small patch (aigainst current svn) that implement the 
writeColumnDropStmt method for firebird and interbase.
Should I create a new bug entry for this, or post such messages to the 
developper list?
(I have some difficulties using that jira thing)

have a nice day
-- 
Renaud MICHEL
defimedia S.A.
------------------------------------------------------------------------
Parc Crealys
Rue Phocas Lejeune, 32
B-5032 GEMBLOUX
http://www.defimedia.be/
Tél: +32 (0)81 72 01 06
------------------------------------------------------------------------
Le groupe defimedia:
Definition - IMmedia - Visiocom / AToms - Deficall
Index: src/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java
===================================================================
--- src/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java	(revision 385550)
+++ src/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java	(working copy)
@@ -126,6 +126,16 @@
 
     /**
      * [EMAIL PROTECTED]
+     */
+    public void writeColumnDropStmt(Table table,Column column) throws IOException {
+        writeTableAlterStmt(table);
+        print("DROP ");
+        printIdentifier(getColumnName(column));
+        printEndOfStatement();
+    }
+
+    /**
+     * [EMAIL PROTECTED]
      * @todo : we are kind of stuck here, since last insert id needs the database name..
      */
     public String getSelectLastInsertId(Table table)
Index: src/java/org/apache/ddlutils/platform/interbase/InterbaseBuilder.java
===================================================================
--- src/java/org/apache/ddlutils/platform/interbase/InterbaseBuilder.java	(revision 385550)
+++ src/java/org/apache/ddlutils/platform/interbase/InterbaseBuilder.java	(working copy)
@@ -158,4 +158,15 @@
     {
         // we're using a generator
     }
+
+    /**
+     * [EMAIL PROTECTED]
+     */
+    public void writeColumnDropStmt(Table table,Column column) throws IOException {
+        writeTableAlterStmt(table);
+        print("DROP ");
+        printIdentifier(getColumnName(column));
+        printEndOfStatement();
+    }
+
 }

Reply via email to