Victor Batista wrote: (unfortunately not to the list, but directly)

> Hello!
>       What are my options to create foreign key constraints 
> with sapdb 7.4.03?
>       Can I only create them when I create the database?
> 
>       Thanks in advance,
>               Victor Batista

Referential constraints can be defined during CREATE TABLE
(very common, because usually people know the schema they want to
define in advance) or they can be defined with ALTER TABLE,
but not with the syntax you used.


Elke
SAP Labs Berlin 


> -----Original Message-----
> From: Zabach, Elke [mailto:[EMAIL PROTECTED]]
> Sent: quarta-feira, 11 de Dezembro de 2002 6:42
> To: 'Victor Batista'
> Subject: FW: Foreign key constraints and Sap DB 7.4.03
> 
> 
> Hi,
> 
> the decision was made that we will not include the change 
> into 7.3 or 7.4.3.
> We have to slow down/stop feature-development for 7.3 / 7.4.3 
> to have enough
> time
> to do what has to be done for further releases (7.4.4.* and so on)
> Sorry.
> 
> Elke
> SAP Labs Berlin
> 
> -----Original Message-----
> From: Zabach, Elke
> Sent: Dienstag, 10. Dezember 2002 17:03
> To: 'Victor Batista'; [EMAIL PROTECTED]
> Subject: RE: Foreign key constraints and Sap DB 7.4.03
> 
> 
> 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