In addition ...
If you wish, you may take advantage of the cool Data Designer (RBDefine)
GUI interface to manage all Keys/Indexes, as follows:
Database Explorer | Tables | Design Tables ... | Keys/Indexes | New Key ...
Then, follow the steps to add Foreign Key or click on [Help] button for
complete details.
Very Best R:egards,
Razzak
At 12:59 PM 7/3/2013, Bruce A. Chitiea wrote:
RBGeX95(64) 9.5.2.20611
The codes:
'ALTER TABLE TransTest2 ADD FOREIGN KEY (glCodeID) REFERENCES glCode'
and
'ALTER TABLE TransTest2 ADD FOREIGN KEY (glCodeID) REFERENCES glCode
(glCodeID)'
... elicit the error message:
'The referenced table does not exist (2801)'
The referenced table and columns most certainly do exist, all data types
match.
Bruce,
Without knowing all details, here is an example of adding a FK, using the
RRBYW18 sample database.
-- Example
ALTER TABLE `SalesBonus` ADD FOREIGN KEY (`EmpID`) +
REFERENCES `Employee` +
('Cannot have an employee id that does not exist in the Employee table.', +
'Cannot change employee id number to a value that does not exist in the +
employee table.')
Notice the database setting for IDQUOTE as well as the message to be displayed.
Hope that helps!
Very Best R:egards,
Razzak.
www.rbase.com
www.facebook.com/rbase
--
30+ years of continuous innovation!
15 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--