Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLcommit...
Message
 
À
20/06/2002 11:21:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00670654
Message ID:
00670793
Vues:
15
You need to be inside a transaction for commands like SQLCommit, SQLRollback to make effect.

I believe that, in Oracle, if you don't start a transaction explicitly, each SQLExec will automatically start and end its own transaction -- making the call to SQLCommit unnecessary.

Take a look at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxtk00/html/ft00i6.asp

to see how to make use of transactions in VFP client/server app.





>I was working with the following code:
>** Send the SQL statement to the Oracle database
> returnValue=sqlexec(gnOracleConnection, sqlString)
>
> if returnValue=-1 then &&if sqlexec failed
> errormessage = "The Oracle connection gnConnection value is " + str(gnOracleConnection) + chr(13)
> errormessage = errormessage + "The error number should be " + str(error())+ chr(13)
> errormessage = errormessage + "The error message should be " + message() + chr(13)
> errormessage = errormessage + "The ticket number being updated was " + alltrim(RECORDNUM) + chr(13)
> messagebox(errormessage)
> return
> endif
>
> sqlcommit(gnOracleConnection)
>
>where sqlstring is a SQL command and gnOracleConnection was earlier defined as STORE SQLCONNECT('dsn', 'username', 'password') ;
> TO gnOracleConnection.
>
>I commented out the line sqlcommit(gnOracleConnection) and the program still added the records to the database. What's the point of the sqlcommit?
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform