Jump to content

philirving

Members
  • Posts

    1
  • Joined

  • Last visited

philirving's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. 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.
×
×
  • Create New...