Apr 11, 2004 #1 igorios Programmer Apr 11, 2004 1 AT i only got an shallowly aproach now to progress 9.1 and im pining in defining a "simple" foreign key from one table to another! -- thanks for help
i only got an shallowly aproach now to progress 9.1 and im pining in defining a "simple" foreign key from one table to another! -- thanks for help
Apr 14, 2004 #2 tvrtko Programmer Nov 26, 2003 53 HR You can't define foreign key in Progress db because it knows nothing about foreign keys, referential integrity etc. Relations between tables you should implement "manually" First you should create index that contains foreign key fields (relations can work without it, but it'll be faster with index). If you have table Orders that can be CustomerID field. Then you can say something like: FOR EACH Order WHERE Order.CustomerID = 123 USE-INDEX xCust: /*CODE*/ END. Or if you find the customer first: FIND FIRST Customer WHERE Customer.CustomerID = 123 NO-LOCK NO-ERROR. /* assuming that customer was found... */ FOR EACH Order OF Customer USE-INDEX xCust: /*CODE*/ END. Upvote 0 Downvote
You can't define foreign key in Progress db because it knows nothing about foreign keys, referential integrity etc. Relations between tables you should implement "manually" First you should create index that contains foreign key fields (relations can work without it, but it'll be faster with index). If you have table Orders that can be CustomerID field. Then you can say something like: FOR EACH Order WHERE Order.CustomerID = 123 USE-INDEX xCust: /*CODE*/ END. Or if you find the customer first: FIND FIRST Customer WHERE Customer.CustomerID = 123 NO-LOCK NO-ERROR. /* assuming that customer was found... */ FOR EACH Order OF Customer USE-INDEX xCust: /*CODE*/ END.