Subscribe to this thread
Home - General / All posts - Querying Drawing Table and link with other Drawing
jersonics27 post(s)
#12-Sep-14 10:11

Hi, please help me what to do:

I have a drawing say CLASSROOM polygon which has ROOMID column and i have also other drawing which are points say SCHED drawing and it has ROOMID and CLASSTIME columns. If i want to use the query toolbar of Manifold querying the SCHED drawing and say example:

Query Toolbar: CLASSTIME Starting with 07:30AM and then Select.

So all records which has 07:30AM will highlight in this table. However, i would like to link it with my CLASSROOM polygon and instead it will also select the polygon which has the ROOMID equal to the ROOMID from the selected points.

I hope you can help me.

Thanks.

jersonics

jersonics27 post(s)
#14-Sep-14 03:41

and if i want to add or link another drawing CLASSROOM2 which has also ROOMID, what is the correct SQL on this?

I have an sql that doesnt work, pls correct and after that i will link a drawing with geoms...select the query...

this is the sql:

SELECT [CLASSROOM1].[geom (I)], [CLASSROOM2].[geom (I)], [SCHED Table].*

FROM [CLASSROOM1], [CLASSROOM2], JOIN [SCHED Table]

ON [CLASSROOM1].[ROOMID] = [SCHED Table].[ROOMID],

[CLASSROOM2.[ROOMID] = [SCHED Table].[ROOMID];

Please help.

jersonics

KlausDE

6,410 post(s)
#15-Sep-14 17:57

There is an uncalled-for comma in front of JOIN. With Manifold SQL I'd prefer two WHERE clauses instead of the JOIN. The JOIN doesn't include [CLASSROOM1]. So ' [CLASSROOM1].[ROOMID] = [SCHED Table].[ROOMID] ' will fail.


Do you really want to ruin economy only to save the planet?

jersonics27 post(s)
#16-Sep-14 00:54

can you please revise my sql, what's the correct sql here? i tried but i still dont get it.

thank you.

jersonics

jersonics27 post(s)
#17-Sep-14 07:35

here's my revised sql that doesn't work, please correct...

SELECT [CLASSROOM1.[geom (I)], [CLASSROOM2].[geom (I)], [SCHED Table].*

FROM [CLASSROOM1], [CLASSROOM2], [SCHED Table]

where [CLASSROOM1].[ROOMID] = [SCHED Table].[ROOMID] AND

[CLASSROOM2].[ROOMID] = [SCHED Table].[ROOMID];

please help me.

thanks.

Graeme

990 post(s)
#17-Sep-14 07:53

Looks as though you need to add [CLASSROOM1].[ROOMID] and [CLASSROOM2].[ROOMID] to you SELECT statement, otherwise your "where" has nothing to work with.

Consider posting a sample map file so others have something to work on.

jersonics27 post(s)
#17-Sep-14 09:15

here's the map attached.

what i want is that, i'm going to use the query toolbar, selecting the SCHED drawing,

Query Toolbar: TIME Starting with 07:30 and then Select. However, i want also any of the CLASSROOM drawing will be highlighted equal to the ROOMID selected.

please help for the correct query on this.

thanks.

jersonics

Attachments:
CLASSROOM_SCHED.map

jersonics27 post(s)
#18-Sep-14 03:40

can someone help me here pls...

thanks.

Graeme

990 post(s)
#18-Sep-14 04:04

It would be straight forward if your classrooms were in a single drawing - any reason why they're separate?

jersonics27 post(s)
#18-Sep-14 04:49

i cant be in one drawing since it has different buildings and different floors for example. still i cant figure it out. please help me for the exact sql.

thanks.

jersonics27 post(s)
#18-Sep-14 06:37

please if someone can help me, i need to present tomorrow. thanks.

Graeme

990 post(s)
#18-Sep-14 07:27

The problem seems you will always get two or more geoms returned by a query calling two or more drawings, a linked drawing can only draw on a single geom. In the update, two queries and linked drawings will give you a visual indicator (the linked drawing objects) but you have to refresh each after changing the point selection.

The composite classrooms drawing and query will do what you seem to want, the drawing has had two additional columns added, one for building and another for level (floor), formatting allows you to distinguish them in a single drawing (Map 2).

This might get you over your deadline, with a bit of bluffing, until you or someone else can turn on the full SQL light. Good luck.

Attachments:
CLASSROOM_SCHED_Updt.map

jersonics27 post(s)
#18-Sep-14 08:49

Hi Graeme, thanks for the help, but sorry im still not satisfied with the query, for more clarification...

- what i want is to run first the query then i will link a drawing, This Project... (Table with geometry column) Source: the query

- then i can use the query toolbar selecting the TIME: 07:30, that should highlight the CLASSROOM drawing equal to the ROOMID selected from SCHED.

- i dont want to merge all CLASSROOM drawings because i just want to tile vertically the MAPS for every CLASSROOM/BLDG coz it has different floors also, i just didn't indicate in my table.

- attached herewith is the query that works (compliments from atomek) but it's for CLASSROOM1 only, how about linking with CLASSROOM2, or multiple drawings.

from atomek:

SELECT c.[geom (I)], t.*

FROM [CLASSROOM1] c JOIN [SCHED] t

ON c.[ROOMID] = t.[ROOMID]

please help me again.

Attachments:
CLASSROOM_SCHED_query.map

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.