db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Huber (JIRA)" <j...@apache.org>
Subject [jira] Created: (DDLUTILS-160) incorrect primary key create statement
Date Wed, 28 Feb 2007 16:12:57 GMT
incorrect primary key create statement

                 Key: DDLUTILS-160
                 URL: https://issues.apache.org/jira/browse/DDLUTILS-160
             Project: DdlUtils
          Issue Type: Bug
          Components: Core - MaxDB/SapDB
         Environment: Windows, SapDB 7.4
            Reporter: Stefan Huber
         Assigned To: Thomas Dudziak

The sql builder creates primary keys with a statement like

          alter table ADDRESS add constraint 'pk_name' primary key (ID)

This statement does not work with SapDB. It uses a statement like

         alter table ADDRESS add primary key (ID)

I worked around this problem by overwriting writeExternalPrimaryKeysCreateStmt in SapDbBiulder

    protected void writeExternalPrimaryKeysCreateStmt(Table table, Column[] primaryKeyColumns)
throws IOException
        if ((primaryKeyColumns.length > 0) && shouldGeneratePrimaryKeys(primaryKeyColumns))
            print("ALTER TABLE ");
            print("ADD ");
            writePrimaryKeyStmt(table, primaryKeyColumns);

This syntax omits the primary key name, but i couldn't find a syntax in the SapDB documentation,
that supports primary key names.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message