Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Hi Mike,
is this to add an Upsert into vfp SQL or a wish for arbitrary backends ?
On first reading impression is you don't trust the gods of Commit and Rollback.
Or is your aim a solution to check, prune, fix and send bulk row operations ?
curious
thomas
>There is a SQLParser class in the downloads, but that only works for Selects. What I am wanting to do is parse an insert command and get the PK column names (already have that) and then extract the values of the pk columns from the insert so that I can execute a test to see if the primary key will be violated by the insert.
>
>The system I inherited is doing sqlexec without any checking. I am trying to encapsulate a set of abilities into a new ??sqlexec, such as checking if the connection is valid, wait for it if it's busy, etc. There may be a primary key or other constraint on the table so that this could fail:
>
>insert into table (field1, field2, field3) values ("a",1,{^2021/03/30})
>
>Assuming field1 is the primary key I want to generate a sql command
>
>select field1 from table where field1 = "a"
>
>I can then execute that before the insert. Or I could combine the 2 commands into a single SQL:
>
>insert into table (field1, field2, field3) values ("a",1,{^2021/03/30}) where not exists (select field1 from table where field1 = "a")
>There may already be a where clause, so if I had a collection of pieces it would be easy to decide where to add a new one.
>
>Thanks
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