This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes Update statement doesn't ... update Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Update statement doesn Watch "Update statement doesn New topic
Author

Update statement doesn't ... update

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Hello,

I have a simple Oracle 10g update statement I run in SQL developer.

I try to issue an update, followed by a commit, followed by a SELECT statement on what should have been updated.

I find that the SQL statement below I run after the commit does show the new value, but if I shut down SQL Developer and re-start it, then I see that nothing was actually committed.

Oracle gives me the time it took to run the statement with no errors.

The syntax is like this:

Update users set field1="some value", set field2="another value", ..... where userid="12345" ;
commit;
select * from users where userid ="12345";

--------------

Any ideas why this doesn't do the commit as expected?

Thanks.

-- Mike
Sona Patel
Ranch Hand

Joined: Mar 30, 2009
Posts: 75
Hi Mike,

If you shutdown sql developer without committing then the changes done by you will not get reflected to database.

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Sona Patel wrote:Hi Mike,

If you shutdown sql developer without committing then the changes done by you will not get reflected to database.



Did you see the "commit;" line above?

My question is why doesn't this actually "commit"?

I can't leave SQL Developer open forever.

-- Mike
Sona Patel
Ranch Hand

Joined: Mar 30, 2009
Posts: 75
Hi Mike...

got that...I have downloaded sql developer. I will install it and will do what you did.
Now lets see if that is the case at my end or not.
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Thanks...look forward to hearing about your results.
Sona Patel
Ranch Hand

Joined: Mar 30, 2009
Posts: 75
Hey Mike,

I tried that on my machine with Oracle 9i.

i closed sql developer window and next time i could see modifications done by me on database.

No issues at my end with sql developer.

It may be something related to your database settings.
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Sona Patel wrote:Hey Mike,

I tried that on my machine with Oracle 9i.

i closed sql developer window and next time i could see modifications done by me on database.

No issues at my end with sql developer.

It may be something related to your database settings.


OK, thanks for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Update statement doesn't ... update
 
Similar Threads
db2 - 703 certification
DB2 700 and 701 - Test Sample
Get Updated Record
sql statement problem
preparedStatement with like where clause