Hi, In a database, I have 2 tables: tb1 and tb2. Tb1 has a primary index (mytag1), and a 'for' condition (for not deleted()). Tb2 also has a primary index (mytag2).
If I want to establish a relationship between tb2 and tb1 in a program, using: alter table tb1 add fore key mytag2 tag mytag1 refe tb2 I receive the warning: 'mytag1 already exists, and is a PRIMARY or CANDIDATE index tag. Overwite it?' The options being 'Yes' or 'No'. As I want to preserve the for condition, of course I have to press 'No' button. Eminem live from new york city download cd. But this is a risk in a program, where the user might choose 'Yes', and spoil everything. Can anybody advice me?
OS() function in Visual FoxPro. I'm running VFP 9.0 SP2 under Windows 7 Ultimate SP1. When I call the OS() function, it returns Windows 6.01 I'd like to be able to identify which operating system is running because I'm calling a very old 16-bit utility (and it doesn't work in the modern world). I'd like to be able to switch between the old one.
Thank you, Florin Cherbis Sat, 28 May 2005 23:24:27 GMT. > In a database, I have 2 tables: tb1 and tb2. Tb1 has a > primary index (mytag1), and a 'for' condition (for not > deleted()). Tb2 also has a primary index (mytag2).
> If I want to establish a relationship between tb2 and tb1 > in a program, using: > alter table tb1 add fore key mytag2 tag mytag1 refe tb2 If you're adding a new column to your table and you want an index on it why are you giving it the TAG name you are using for the existing index? Seems to me you should use the name of the new field for the TAG - something like: ALTER TABLE Tb1; ADD FOREIGN KEY MyTag2 TAG MyTag2; REFERENCES Tb2 -- Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP Sun, 29 May 2005 07:37:52 GMT. Hi, I am not adding a new field (column as the command says). I just wanted to create the relationship between the 2 tables, that already have each a tag in their.cdx compound structural index (mytag1 for tb1 and mytag2 for tb2).
I cannot change the name of tags (they already are used in a lot of places allover the app, and I have to keep the 'for not deleted()' filter for mytag1. If I'd use the sentence you proposed, I guess another (new) tag will be added to the tb1's.CDX index, designing of course the same field but without being primary and without 'for.' Filter, am I right? And I do not want this (in fact, is not the problem if I want it or not, but I have to use the existing.CDX's tag names and conditions.
I hope I was more specific this time and I made myself understood. I very lot appreciate your help, thank you. Florin Cherbis. >Hi, >I am not adding a new field (column as the command says). >I just wanted to create the relationship between the 2 >tables, that already have each a tag in their.cdx >compound structural index (mytag1 for tb1 and mytag2 for >tb2). I cannot change the name of tags (they already are >used in a lot of places allover the app, and I have to >keep the 'for not deleted()' filter for mytag1.
If I'd >use the sentence you proposed, I guess another (new) tag >will be added to the tb1's.CDX index, designing of >course the same field but without being primary and >without 'for.' Filter, am I right? And I do not want >this (in fact, is not the problem if I want it or not, >but I have to use the existing.CDX's tag names and >conditions. >I hope I was more specific this time and I made myself >understood. >I very lot appreciate your help, thank you.
>Florin Cherbis For temporary relations use SET RELATION TO For persisten relations, the complete sintax of ALTER TABLE is: ALTER TABLE TableName1 ADD ALTER [COLUMN] FieldName1 FieldType [(nFieldWidth [, nPrecision])] [NULL NOT NULL] [CHECK lExpression1 [ERROR cMessageText1]] [DEFAULT eExpression1] [PRIMARY KEY UNIQUE] [REFERENCES TableName2 [TAG TagName1]] [NOCPTRANS] [NOVALIDATE] See the [REFERENCES TableName2 [TAG TagName1]] modifier. Alex Feldstein ________________________________ Microsoft Visual FoxPro MVP Please respond in the public groups so that everybody can benefit from the exchange. Favor de responder en los foros pblicos asi todos se benefician. Address scrambled with ROT-13 Sun, 29 May 2005 22:20:58 GMT. Dear Alex, I used exactly the sintax you're reffering to, that is: ALTER TABLE details ADD FOREIGN KEY name TAG names REFERENCES orders TAG name But it is not all right for me, because in this moment, the 'names' tag in the 'details' table is transformed from a primary index into a regular index (if I put SET SAFETY OFF), or the user is put to take a decision, and he had to know that he has to choose 'No', not permitting modification of the index (if I put SET SAFE OFF).