Andrew,
Unfortunately you can't use the update statement with the syntax you've
used. The only 'where' that is valid with the update statement is 'where
RowID = x' which allows you to update one row only. Otherwise the update
statement should have no where clause, in which case all rows in the tables
will be updated. Not what you want in this case.
The workaround is to do a select first, then update the Selection table:-
Select * from tblPostDist where tot_custs > target_custs
Update Selection set target_custs = tot_custs
Keith
-----Original Message-----
From: Andrew Whittam [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2001 14:40
To: '[EMAIL PROTECTED]'
Subject: MI-L Update query in MI
Hi - I'm sure that this has been covered loads of times but I can't find any
record of it.
I want to update a table on the basis of a condition i.e. (in SQL terms)
update tblPostDist
set target_custs=tot_custs
where tot_custs>target_custs
I can't see any way of issuing the where condition, I've tried typing the
above code into the MapBasic window and the response was something like
"unable to update target_custs"
Any help/ideas/note of limitations is appreciated.
Cheers - Andrew
_________________
Andrew Whittam
Senior Business Analyst
Tel: 020-7349 4087
Fax: 020-7349 4001
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.
This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.