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)
        
        JBoss logs have the following:

###########
        Caused by: com.sap.dbtech.jdbc.exceptions.DatabaseException:
[-3014] (at 56): Invalid end of SQL statement
        at
com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:
69)
        at
com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:7
20)
        at
com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:405)
        at
com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:302)
        at
com.sap.dbtech.jdbc.StatementSapDB.sendCommand(StatementSapDB.java:693)
        at
com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:736)
        at
com.sap.dbtech.jdbc.StatementSapDB.execute(StatementSapDB.java:238)
        at
com.sap.dbtech.jdbc.StatementSapDB.executeUpdate(StatementSapDB.java:383
)
        at
org.jboss.resource.adapter.jdbc.local.LocalStatement.executeUpdate(Local
Statement.java:231)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.addForeignKeyConstraint(
JDBCStartCommand.java:375)
        ... 83 more
###########

        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

        

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

Reply via email to