philirving Posted October 24, 2020 Share Posted October 24, 2020 I want to NOT complete the transaction if there is no record with AcctNum="1001". For instance:begin transaction; update Accounts set Bal=Bal-250 where AcctNum="1001"; update Accounts set Bal=Bal+250 where AcctNum="2002"; commit transaction When I do this (in SQLite) AcctNum 2002 gets the 250 even if there is no record AcctNum="1001". How can I stop the transaction, and perhaps show an error message? Very simple table to test with: create table [Accounts] ( [AcctNum] char[4] primary key not null, [Bal] real ) ; insert into Accounts values ("2002",500.0); insert into Accounts values ("2005",250.0) ; Thanks in advance. Link to comment Share on other sites More sharing options...
niche Posted October 29, 2020 Share Posted October 29, 2020 https://stackoverflow.com/questions/6833867/close-kill-transaction Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now