Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AutoInc troubles
Message
De
01/07/2003 04:19:09
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
01/07/2003 03:07:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00805589
Message ID:
00805604
Vues:
15
Hi Grigore,

I do not use AUTOINC for the the reasons you show. The only information vfp gives us about the next record to create (not the currently created one!!) is available with AFIELDS() column 17 or COPY STRUCTURE EXTENDED column Field_Next.

Since I do all my work based on views I have no idea how to use it.

Agnes

>Hello, everyone
>
>I am trying to use this new kind of field. Works fine, unless I use a view to update the table and I need to know the value, to use it in a secondary table, as FK. In SQL Server we have @@Identity, which returns the last integer value inserted, but I have absolutely no idea how to handle this in VFP. According to the help, I need to do a REQUERY to see the new value.
>
>Are they kidding me or do I miss something here? First, the whole thing is in a transaction - can't REQUERY() in transactions. Second, to REQUERY() I need a parameter, which, in this case, is exactly the value I need to know - the Autoinc PK. Deadlock. If I don't use any parameter, I'll get all the records, and even me I'm not stupid enough to do such thing. Another deadlock.
>
>There is another way: SELECT * FROM table WHERE field1 = value1 AND field2 = value2 ... .... ........, where "values" are the brand new inserted values. First - a lot of work just to get an integer. Second, I'm not 100% sure I'll get one single record - there could exist duplicate records, only their PK is different. Another deadlock.
>
>Nah. I'd better stick using the Tastrade way.
>
>What do you do in such cases, guys? I can't believe I'm the first one having this problem....
>
>Thank you
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform