Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Get The Name Of An Auto Increment Field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01285380
Message ID:
01285396
Vues:
15
>Ok, here's the problem with this.
>
>I'm working on a legacy app. I'm writing a process that automatically inserts records into
>a DBF.
>
>There is a default value for the PK field:
>
>
new_pk("custpoc","poc_pk")
>
>which calls a stored proc that returns the row's PK value.
>
>My process forms an INSERT statement, which is throwing an error "Uniqueness of index POC_PK is violated."
>
>Not all tables are calling this stored proc, so this presents a problem.
>
>I'm trying to make my process generic so that I can use it in any app. I need a way to
>exclude the PK column from the insert statement when this rule is in place.
>
>Anyone?
>

You can get default value of the field with cursorgetprop() function, if memory serves. You can also found out with ataginfo() (?) function if there is a primary/candidate index that matches the field. Then you would be able to exclude the field.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform