try adding it in the table designer then unload the table structure to get
the code. I think you need the 'cannot insert...' messages but not 100% on
this.
It is something like...
ALTER TABLE `tran_spd` ADD FOREIGN KEY +
( `treat_dr` )+
REFERENCES `DRINFO` +
('Cannot insert - value does not exist in DRINFO',+
'Cannot update - value does not exist in DRINFO')
----- Original Message -----
From: "Albert Berry" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, March 16, 2010 1:57 AM
Subject: [RBASE-L] - Re: Temp Tables
You must have a primary key on DRINFO before you can apply the FK on the
temp table. I just tested, and I can apply the FK from the table designer,
but get the same error message when I try to create it at the R> prompt.
MDRD wrote:
Hi
Can you have a FK on a Temp Table?
ALTER TABLE `tran_spd` ADD FOREIGN KEY ( `treat_dr` ) +
REFERENCES `DRINFO`
I keep getting an error "referenced table does not exists.."
Thanks
Marc