Marc, I am going to guess that FKs are not allowed on temporary tables because their creation would allow a user to lock the database structure.
For example, if you have TableA with PK and a temporary TableB with a FK that ties it to TableA, if you want to delete TableA or remove the PK, you would need to either remove the FK for TableB or delete TableB first. This would not be a problem with permanent tables as they are accessible to all users. However, since temporary tables are by definition local and available only to the creator of the table, they would prevent anyone else from modifying the master table...this would not be desirable. Again, and as other have suggested, you can always verify the validity of the temporary data very easily, before upgrading the master table. Javier, Javier Valencia, PE 913-829-0888 Office 913-915-3137 Cell 913-649-2904 Fax ________________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of MDRD Sent: Tuesday, March 16, 2010 1:12 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: Temp Tables Thanks Karen and all I can just use a Rule, funny that PK's are allowed but FK are not. I must be ahead of my time... LOL Marc From: [email protected] Sent: Tuesday, March 16, 2010 12:45 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: Temp Tables Marc: I just tried it here and I get the same error message, that the referenced table does not exist. So I think FKs are not allowed on temp tables. But I'm with other posters -- I have never even thought of creating an FK on a temp table. Since you obviously need to write code to do something with the temp table, just write one line of code that checks that the FK data is in the PK table. Karen I did Unload structure for InvoiceHeader in RRBYW14 Change the table name to IHTemp then ran the code below. I get errors when Adding the FK's Either I am missing the nose on my face or FK's are not allowed on Temp Tables? Marc

