We have gotten the same error - we were forced to use if then and hardcode the options - thankfully there were only 3.
 
The hardcoded "update" statement works but when the a string is used to generate the command an error occurs.  We have found that ONLY the "UPDATE"  command has this problem - the "SELECT" does just fine. Maybe MI Tech support should look at this. 

Chuck Collins
mailto:[EMAIL PROTECTED]
Nucomm Data, Inc.
(612) 591-0820
http://www.mnmaps.com
=====================

 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Darren Murphy
Sent: Wednesday, January 13, 1999 12:33 AM
To: [EMAIL PROTECTED]
Subject: Re: MI MBasic Pro. - Help needed with Update Table Statement....a bit more

Hi again,

Further to my original query....I thought that perhaps I could get around my problem by constructing the command within a string variable and then issuing it using the 'Run Command' statement...but no...it seems not.

Consider this....

Update mytable Set Col18 = newrecord where rowid = selected

works quite fine..which of course you would expect, but....

cmd_update="Update mytable Set Col18 = newrecord where rowid = selected"
Run Command cmd_update

produces an error stating that 'Variable or field newrecord is not defined'. I can assure that the variable newrecord is indeed defined...of course the first example wouldn't work were it not.

Now...I'm sure that I'm probably missing something quite fundamental here, but I'm afraid I'm going to need someone to point it out to me.

again....any help will be muchly appreciated :)


At 10:45 13/01/99 +0900, Darren Murphy wrote:
>Hello List,
> can anyone tell me if it is possible to reference a column using
>a smallint variable when using the Update statement?
>
>eg. Update table_name Set col(smallint)=blah where rowid=blahblah
>
>Its possible to do it when reading the contents of a table eg.
>table_name.col(SmallInt), so it would seem logical to me that you should
>also be able to use a similar syntax when updating a table, but this seems
>to not be the case.
>
>Obviously, the above syntax doesnt work, but is there a way to do this that
>I have missed in the help files, or does somebody know of some other way
>around it?
>
>Any help, or even confirmation that it cant be done, would be appreciated.
>
>regards,
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Darren Murphy Technical Officer
Bureau of Meteorology Darwin NT (Australia)
Phone +61 8 89203818 Fax +61 8 89203842
http://www.nt.bom.gov.au/ntregion/obs/obs.html (work)
http://www.darwin8ball.org (play)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------------------------------------------- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to