Try converting the result of teh ObjectInfo using Str$() and Val()

Fields {STREET, Val(Str$(ObjectInfo(obj,22))) "N"}
Tables {Act_st}
Where {}
Group {}
Order {}
Into {Selection}

The "problem" with the ObjectInfo() - and other MapBasic - functions is
that
some of them can return different datatypes, numbers, string etc.

By converting the result to String you get a more "clean" datatype.

Peter
------------------------------------------------------------------------------------------------
Peter Horsb�ll M�ller, GIS Udviklingskonsulent / GIS-Developer
Kampsax A/S - GIS Software & Solutions
Rugaardsvej 55, 5000 Odense, DK
tel: +45 6313 5013,  dir:+45 6313 5008,  fax: +45 6313 5090
mailto:[EMAIL PROTECTED]
www.kampsax-gis.dk and www.kampsax.dk
Authorized MapInfo Partner & Distributor in Denmark and Norway.
------------------------------------------------------------------------------------------------
Se mere om Dansk MapInfo Brugerkonference p� 
http://www.kampsax-gis.dk/Default.asp?ID=296

Klik ind p� http://www.kortal.dk og se det hele lidt fra oven!
Check http://www.kortal.dk and have a look at Denmark from above!
----- Videresendt af Peter M�ller/Kampsax - 07-10-2002 08:13 -----
                                                                                       
                                     
                    "David M Haycraft"                                                 
                                     
                    <[EMAIL PROTECTED]        Til:    "MAPINFO-L" 
<[EMAIL PROTECTED]>                   
                    ne.net.au>                    cc:                                  
                                     
                                                  Vedr.:  MI-L Question about MapInfo 
SQL                                   
                    05-10-2002 00:53                                                   
                                     
                                                                                       
                                     
                                                                                       
                                     



Dear MapInfo SQL Users

I believe that I have discovered a class of MapInfo queries that are
ill-behaved, and whose behaviour has not previously been reported.

These queries have a "calculated column" created by a Select clause
expression involving the ObjectInfo() function.

For example:

Fields {STREET, ObjectInfo(obj,22) "N"}
Tables {Act_st}
Where {}
Group {}
Order {}
Into {Selection}

where Act_st is a StreetInfo file.

(I'm trying to get stats on the numbers of polyline nodes in certain
certain
street centreline tables.
ObjectInfo(Obj,22) return the number of nodes in the first section of a
polyline object.  For sure my input is a homogeneous polyline table.)

Although the queries execute correctly and create a result set, you cannot:

* use the query result set as input to a Group By query (MapInfo diagnostic
"Unable to create new table")

* save a copy of the query result set (MapInfo diagnostic "Unable to create
new table")

* export the query result set to a MIF file (MapInfo diagnostic "Unknown
error encountered" on import)

The work-around is to permanently add a new column to the base table to
hold
the value returned by ObjectInfo() and then use "update table set
N=ObjectInfo(Obj,22) " to store the values.

Can anybody confirm this finding?

David M Haycraft
Information Analysis Associates  Pty Ltd
Aust Capital Territory,  Australia
Email:  [EMAIL PROTECTED]
Web :  www.acslink.aone.net.au/actaa/iaa.htm



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 3417





---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 3427

Reply via email to