Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Exec & transaction management
Message
De
22/03/2010 09:12:04
 
 
À
15/03/2010 12:03:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01454579
Message ID:
01456074
Vues:
31
>Hi
>
>I'm using the following command to return a dataset with a single record:
>
>lnConnectionID = SQLConnect('myRemoteSQLSource', 'myAccountName', 'myPassword')
>lnCandidate = SQLExec(lnConnectionID, 'exec Candidate_Select_CandidateID ?lnCandidateID', 'myResults')
>
>If I want to be able to edit the contents within myResults, and then commit the changes back to SQL Server 2005, what would the syntax be to set this up and then perform the relevant commit. The stored procedure selects a single record, and although it's unlikely that anyone else would have this record open at the same time, I have to take this into consideration just in case.
>
>Regards

Maybe you could write a sp and pass it the values in your cursor.
Something like
LOCAL cSql AS String
SELECT myResults
SCAN
      TEXT to cSql TEXTMERGE NOSHOW
                Exec spMyUpdateProc << p1>>, <<p2>>,.... <<pN>>
      ENDTEXT
   -- nretval = SQLEXEC(nCon,cSql)
ENDSCAN
In most of my work, regardless if the backend data have changed in the meantime, it's the last update that wins the day.
If you can't do that, you'll have to write (lot's) of code to figure out what gets updated by whom.

HTH

Peter
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform