Hi David,
Try this:

CREATE TABLE WORK_ON_CD
(
  ID Integer,
  CD_ID Integer,
  WORK_ON_ID Integer,
  PRIMARY KEY(ID),
  FOREIGN KEY "FK_1" ("CD_ID") references "CD"
("CD_ID"),
  FOREIGN KEY "FK_2" ("WORK_ID") references "WORK"
("WORK_ID")
)


You dont really have to use the double quotes, but
its a good practice.

Regards,
Girish



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> .com]On Behalf Of David Sills
> Sent: Monday, March 03, 2003 12:54 PM
> To: [EMAIL PROTECTED]
> Subject: Question about foreign keys
>
>
> To whom it may concern:
>
> This is my first attempt at using this
> listserv, so
> forgive any errors in execution.
>
> I'm trying to establish a referential integrity
> constraint between two tables in a
> recently-created
> database in SAP DB 7.4 on Windows XP
> Professional. I'm
> using the Database Manager GUI. This
> appears, from the
> description in the SAP DB library and
> downloaded PDF,
> to be very simple. However, I can't get
> it to work at
> all; my implementations are simply ignored.
>
> I have a CAT database with a mapping table:
>
> CREATE TABLE WORK_ON_CD
> (
>   ID Integer,
>   CD_ID Integer,
>   WORK_ON_ID Integer
>   PRIMARY KEY(ID)
>   FOREIGN KEY FK_1 CD_ID references CD
>   FOREIGN KEY FK_2 WORK_ID reference WORK
> )
>
> Both foreign keys reference ID columns in the
> referenced tables, which is pretty ordinary.
>
> How can I get this to work? I've tried
> to D&D the
> tables, but the primary key columns are
> not there to
> be selected. And it ignores me if
> they're not there.
>
> Thanks for any help.
>
> David Sills
>
>
> ________________________________________
> __________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators,
> tips, more
> http://taxes.yahoo.com/
> _______________________________________________
> 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

Reply via email to