SQL Update CheckingAccount ?

General discussion on all other topics under the sun.

Moderator: Renato

Post Reply
winkface
New MMEX User
Posts: 6
Joined: Tue Jan 03, 2017 9:38 pm
Are you a spam bot?: No

SQL Update CheckingAccount ?

Post 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???????????????????
Nikolay
MMEX Developer
Posts: 1535
Joined: Sat Dec 06, 2008 2:27 pm
Are you a spam bot?: No
Location: Sankt-Petersburg, Russia

Re: SQL Update CheckingAccount ?

Post by Nikolay »

This is incorrect
 And TRANSAMOUNT=(995 or 987);
should be 
 And TRANSAMOUNT in (995,987);
winkface
New MMEX User
Posts: 6
Joined: Tue Jan 03, 2017 9:38 pm
Are you a spam bot?: No

Re: SQL Update CheckingAccount ?

Post 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??????????
winkface
New MMEX User
Posts: 6
Joined: Tue Jan 03, 2017 9:38 pm
Are you a spam bot?: No

Re: SQL Update CheckingAccount ?

Post 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.
Nikolay
MMEX Developer
Posts: 1535
Joined: Sat Dec 06, 2008 2:27 pm
Are you a spam bot?: No
Location: Sankt-Petersburg, Russia

Re: SQL Update CheckingAccount ?

Post 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.
Post Reply