Lars et al.,

This might be a work-around. If you use the following query syntax, the SelectionInfo 
function will return the base-table name ("A"):
SELECT * FROM A WHERE A.ID IN (SELECT B.ID FROM B) INTO NEWTABLE

Also, you can use the TABLEINFO function to test for whether the table name returned 
is a base-table:
TABLEINFO(table_id, TAB_INFO_TABFILE), or
TABLEINFO(table_id, TAB_INFO_TEMP)

Regards
Tom Colley
Sustainability Systems Analyst
Blue Mountains City Council
Tel: (61.2) 4780-5451
[EMAIL PROTECTED]


----Original Message--------------------------

Date: Fri, 17 Oct 2003 12:41:06 +0200
To: "MapInfo-L" <[EMAIL PROTECTED]>
From: "Lars V. Nielsen" <[EMAIL PROTECTED]>
Subject: Bug in MapBasic - SelectionInfo ?
Message-ID: <[EMAIL PROTECTED]>

------=_NextPart_000_03A5_01C394AB.EED2B290
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi list,

Can anyone confirm this problem, or better yet suggest a work-around ?

I'm using SelectionInfo(SEL_INFO_TABLENAME) to provide the name of the =
base table from which the current selection is drawn. Usually this works =
fine, but if the selection is a join, e.g. SELECT * FROM A, B WHERE A.ID =
=3D B.ID, it suddenly returns the query name instead, e.g. "Query1", =
instead of "A" !!

The selection *is* made of a base table (it's not stand-alone as when =
one uses a GROUP BY). If I edit something in the query, the base table =
is changed accordingly - as it should be. And the status bar shows the =
correct base table name as "selected". So the connection from the query =
to the base table is definitely in place and working properly, it's only =
MB that errs.

The manual only talks about joined selections giving possible problem =
with SEL_INFO_NROWS:
>>
Note: If the current selection is the result of a join of two or more =
tables,  SelectionInfo(SEL_INFO_NROWS) returns the number of rows =
selected in the base table, which might not equal the number of rows in =
the Selection table.
<<

Nothing at alle talks about returning a different value for =
SEL_INFO_TABLENAME (except blank if no selection)

So I assume this is a bug. It's the same in both 6.5 and 7.0, btw.

Best regards / Med venlig hilsen
Lars V. Nielsen
--------------------------------------------------------
Hvenegaard & Meklenborg
Rugaardsvej 55, DK-5000 Odense C
Denmark
http://www.hvm.dk
------=_NextPart_000_03A5_01C394AB.EED2B290--




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

Reply via email to