Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tastrade newid way
Message
De
24/11/1997 06:35:28
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapour
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00060679
Message ID:
00061882
Vues:
27
>>>>I am using the tastrade newid function. I want to copy data from one table to another table. In the new table, I need to assign surrogated key to each record. I tried using both APPEND FROM ARRAY or INSERT FROM ARRAY and the newid didn't seem to work. Am I correct? I know I can use SCAN+INSERT but is there a better way?
>>>>
>>>>Thanks in advance.
>>>
>>>If NewID() is available (by placing it in the stored procedures of your DBC) and you have NewId() as default value for your primary key field, all should be fine. You can even try this interactively.
>>>
>>>José
>>
>>I found that SELECT ...INTO ARRAY ... followed by APPEND FROM ARRAY ... or INSERT FROM ARRAY .... doesn't take default value. You have to do SELECT .. INTO CURSOR followed by APPEND FROM ARRAY or INSERT FROM ARRAY
>
>Shihchau,
>I never implied arrays would take a default value, how would they? And I don't quite get why you are dealing with arrays in this case.
>
>José

I was talking about APPEND FROM ARRAY vs APPEND FROM CURSOR.The latter takes default value when an appended record's field doesn't have default data while the former doesn't. I was not aware of that and didn't think it would be at first. It was my mistake. I thought using SELECT INTO ARRAY and APPEND FROM ARRAY will be faster and easier to code than SELECT INTO CURSOR and APPEND FROM CURSOR FILE.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform