Closed ryanswapp closed 8 years ago
I'm assuming you are checking the error code from the query. If there's no error, then the update should be succeeding. Are you doing a conn.commit() afterwards?
You are the man! I didn't realize that I had to run conn.commit() afterwards. I just gave it a try and it worked. In what circumstances do you need to run conn.commit()? Every query besides a SELECT?
A commit is a command to the database server to tell it that the transaction you are working on should be considered permanent. Once you've done the commit, you can disconnect and your changes will persist. The opposite is a rollback, which will "undo" any delete, insert, or update statements you've made (a) since the last commit or rollback or (b) since you connected. A commit / rollback isn't technically necessary after selects since you haven't changed anything but it's a good idea anyway since it releases locks held by the connection.
That's good to know. I appreciate your help. Thanks for the quick response!
I don't have much experience with Sql Anywhere and am trying to hook into a legacy system that runs on it. I am able to connect to the database and read from it but my update queries do not seem to be having any effect. For instance, if I run the following query:
The values for first_name and aka_first remain unchanged. However, if I run that exact query inside Microsoft Access the query works and the values for first_name and aka_first are updated.
Database version is 16.0.0.1324
Any idea why this may be happening?