Hello!
Thanks again for your reply.
To make SapDB(7.4.3) Foreign Key constraints work with JBoss, I just
changed the following on "standardjbosscmp-jdbc.xml", "SabDB" Type Mapping
section:
Old line:
<fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3)
REFERENCES ?4 (?5)</fk-constraint-template>
Substituted by:
<fk-constraint-template>ALTER TABLE ?1 ADD FOREIGN KEY ?2 (?3) REFERENCES ?4
(?5)</fk-constraint-template>
Now it is working correctly.
Regards,
Victor Batista
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Zabach, Elke
Sent: ter�a-feira, 17 de Dezembro de 2002 7:37
To: 'Victor Batista'; '[EMAIL PROTECTED]'
Subject: RE: Foreign key constraints and Sap DB 7.4.03
Victor Batista wrote (again directly to me)
> Hi!
> Thanks for your prompt reply!
>
> Can you please give me an example of how can I define
> one referential
> constraint with ALTER TABLE, please?
>
> How would I define the following constraint?
>
> ALTER TABLE DC_SYSTEM ADD CONSTRAINT FK_DC_SYSTEM_FILE
> FOREIGN KEY (fileid)
> REFERENCES DC_FILE (id)
ALTER TABLE DC_SYSTEM ADD FOREIGN KEY FK_DC_SYSTEM_FILE (fileid)
REFERENCES DC_FILE (id)
as the reference manual --> Data definition --> alter table_statement -->...
tells everybody who checks it.
Elke
SAP Labs Berlin
BTW: if SAP Labs liked to be asked directly and to have a one-to-one
communication, the mailing list (with archives and other people to
read and answer) would not exist...
> -----Original Message-----
> From: Zabach, Elke [mailto:[EMAIL PROTECTED]]
> Sent: segunda-feira, 16 de Dezembro de 2002 15:51
> To: 'Victor Batista'; [EMAIL PROTECTED]
> Subject: RE: Foreign key constraints and Sap DB 7.4.03
>
>
> 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
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general