Page 1 of 1

SQL Update CheckingAccount ?

Posted: Tue Jan 03, 2017 9:45 pm
by winkface
These don't work, and I don't know why........ This is day Five on this.......

-------------------------------- A ---------------------------------------------------------------
UPDATE   CHECKINGACCOUNT_V1
SET   PAYEEID=30,
  CATEGID=35,
  SUBCATEGID=74
WHERE  ACCOUNTID=2
  And PAYEEID=335
  And CATEGID=125 
   And TRANSAMOUNT=(995 or 987);

-------------------------------- B ---------------------------------------------------------------

UPDATE   CHECKINGACCOUNT_V1
SET   PAYEEID=30,
  CATEGID=35,
  SUBCATEGID=74
WHERE  ACCOUNTID=2
  And PAYEEID=335
  And CATEGID=125
  And (TRANSAMOUNT=995 or TRANSAMOUNT=997);

Please Help???????????????????

Re: SQL Update CheckingAccount ?

Posted: Tue Jan 03, 2017 10:00 pm
by Nikolay
This is incorrect
 And TRANSAMOUNT=(995 or 987);
should be 
 And TRANSAMOUNT in (995,987);

Re: SQL Update CheckingAccount ?

Posted: Tue Jan 03, 2017 11:38 pm
by winkface
UPDATE   CHECKINGACCOUNT_V1SET   PAYEEID=30,
  CATEGID=35,
  SUBCATEGID=74WHERE  ACCOUNTID=2
  And PAYEEID=335
  And CATEGID=125
  And TRANSAMOUNT in (995,987);

Produces on test --->  SQL Syntax error
This is the error I've been getting all along.
Using --->  General Report Manager
Maybe that's the problem, trying to update using a report manager??????????

Re: SQL Update CheckingAccount ?

Posted: Wed Jan 04, 2017 12:01 am
by winkface
That's the answer, don't use report manager to update...

I user --  SQLiteSpy_1.9.11  -- and the changes took right away.

Thanks for the code correction, I would still be trying to get this to work without that.

Re: SQL Update CheckingAccount ?

Posted: Wed Jan 04, 2017 10:11 am
by Nikolay
FYI
General Report Manager is working only for select ( read only mode).
Any apdates and inserts have been forbiden to avoid DB damage.