You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Stefan Huber (JIRA)" <ji...@apache.org> on 2007/02/28 17:12:57 UTC
[jira] Created: (DDLUTILS-160) incorrect primary key create
statement
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 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.
[jira] Updated: (DDLUTILS-160) incorrect primary key create
statement
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Resolved: (DDLUTILS-160) incorrect primary key create
statement
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DDLUTILS-160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Dudziak resolved DDLUTILS-160.
-------------------------------------
Resolution: Fixed
> 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.