Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement