Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to SEEK in a view - VFP 3.0
Message
 
À
04/09/1996 11:55:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00007245
Message ID:
00007248
Vues:
31
>I have created a remote view in my database through OBDC, and I want to be able to SEEK for a certain value (I am trying to ascertain that the index value does not exist before I try to INSERT into the database. SEEK(), my best friend for lo these many years, doesn't work. I suppose LOCATE would, but I've always thought of LOCATE as an ugly, inferior stepchild.
>
>Is there a SEEK equivalent for remote views?

Have you tried just using a select statement?

i.e. SELECT field FROM table WHERE field = m.value...

You could select that into a cursor, and if the cursor is at EOF(), the value does not exist in the table and thus can be inserted.

Another way is to attempt the insert for all cases and if it errors, check the number. ODBC should pass back a uniqueness violation error (if the field is indexed unique, that is).

A modification of the first method would be a parameterized view. The view would look in the table for all records with field = ?value.

HTH,
Scot.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform