db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DDLUTILS-160) incorrect primary key create statement
Date Thu, 08 Mar 2007 06:32:24 GMT

     [ https://issues.apache.org/jira/browse/DDLUTILS-160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Thomas Dudziak updated DDLUTILS-160:
------------------------------------

    Fix Version/s: 1.0

> 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
>             Fix For: 1.0
>
>
> 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
with
>     protected void writeExternalPrimaryKeysCreateStmt(Table table, Column[] primaryKeyColumns)
throws IOException
>     {
>         if ((primaryKeyColumns.length > 0) && shouldGeneratePrimaryKeys(primaryKeyColumns))
>         {
>             print("ALTER TABLE ");
>             printlnIdentifier(getTableName(table));
>             printIndent();
>             print("ADD ");
>             writePrimaryKeyStmt(table, primaryKeyColumns);
>             printEndOfStatement();
>         }
>     }
> 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.


Mime
View raw message