Victor Batista wrote:
> 
> Hello!
>       I am using Sap DB 7.4.03 Beta on Windows and Linux. I am using
> the Database with the JBoss Application Server.
>       I am having problems with foreign key constraints.
> 
>       JBoss creates the following SQL code:
>               
> ALTER TABLE DC_SYSTEM ADD CONSTRAINT FK_DC_SYSTEM_FILE FOREIGN KEY
> (fileid) REFERENCES DC_FILE (id)
>       
    ..... 
>       When I execute the SQL above on SQL Studio I get the same error:
> 
> ###########
>       Native error: -3014
>       Text: [SAP AG][SQLOD32 DLL][SAP DB]Syntax error or access
> violation; -3014 POS(56) Invalid end of SQL statement.
> ###########
> 
>       I took a look to the SAP DB documentation and the SQL syntax
> seems ok:
> 
>       <referential_constraint_definition> ::=
>       FOREIGN KEY [<referential_constraint_name>]
> (<referencing_column>,...)
>       REFERENCES <referenced_table> [(<referenced_column>,...)]
> [<delete_rule>]
> 
> 
>       Both tables and columns referenced on the SQL exist. I also
> executed the SQL on a different DB ant it worked perfectly.
> 
>       Can any one help me, please?
> 
>       Thanks in advance,
>               Victor Batista

If one checks the add_definition in the alter_table_statement, one can see, that
we only allow to specifiy <constraint definition> using CONSTRAINT <constraint_name>,
but no <referential_constraint definition>.
This is true for 7.4.3. The future version 7.4.* allows what you resp. JBoss are 
looking for.
We will check if we will change 7.4.3 accordingly.
I hope there is a chance to do this statement (not used very often, I hope) by hand
or that you have another chance (some option?) with JBoss and this 
alter_table_statement
which can be used in the meantime.

Thank you for reporting

Elke
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to