AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

One to Many Link Template?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
212 Views, 2 Replies

One to Many Link Template?

I have a polygon topology that has centroid object data. I want to link the
topology to an Access 2k table with a link template. When I do so I only get
some of the centroids linked. The data table only has 13 rows. Each piece of
the 800+ object data can be linked to one of the table rows. When I attempt
this I get 51 links and the others cannot be processed. They match exactly.
When I use the "Convert Object Data to Database Links" tool I get a table
with 800+ rows. Most of this data is duplicated. I want a lookup table that
has a One to Many relationship and not a reference table that has a One to
One relationship.
Any Ideas?

--
Joel
joel@NSPM.harden-assoc.com
remove the NSPM. to email me directly
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Joel,

in general you should be able to link 800 objects to 13 rows in the table, but I
wouldn't recommend doing this, because for most features to complete a unique
key/record is needed.
Map was not designed to work with 'lookup tables', even if you could use them
for querying tasks.

Reading thru the following instructions I starting writing up for using lookup
tables for queries in Map might give you some ideas what is possible/recommended
and what not even if it won't answer your question exactly.

--------------------------------------
Imagine you have 2 tables in one MS Access mdb file where only one (called
'first table') is linked to drawing objects; the second table (called 'second
table') is only linked to the first table by a common column.

In Map you can query data also from the second table by using the syntax
described in the following scenarios in all commands that offer an SQL
'Expression' option, for instance in Map > Query > Define Query > Alter
Properties.

Scenario 1
You could now query values from the second table in the mdb file by using the
following expression:

&SecondTableName.ColumnNameToQuery@LinkTemplateNameForFirstTable

This would just query all entries from the specified column name of the second
table, but that's probably not really what you're looking for, because there's
no connection to the table that is linked to the obects whereas with a lookup
table there's a (one-to-many) relation between the
tables.

Scenario 2
To get only the records from the second table queried that are linked to the
first one you'd need a column that exists in both tables (with the same name and
field type). The expression would then be:

&SecondTableName.ColumnNameToQuery@LinkTemplateNameForFirstTable.LinkingColumnName

Scenario 3
Now, if the column name that links the 2 tables doesn't have the same name you
have to specify the corresponding field names in the expression:

&SecondTableName.ColumnNameToQuery@LinkTemplateNameForFirstTable.LinkingColumnNameInFirstTable.LinkingColumnNameInSecondTable

And finally, if the tables are not in the same scheme and/or catalog you'd have
to define it for the second table on the left side of the @:

&Catalog.Scheme.SecondTableName.ColumnNameToQuery@......

Summary:
This means that you can use lookup tables with all Map functionalities where SQL
Expressions are allowed. That works e.g. for reports, but in the drawing itself
when working with drawing objects and the DataView the linkage between the 2
tables is not available for use (for example
it doesn't work to highlight a row in the lookup table and get all linked rows
in the actually linked/first table highlighted, or even more also the linked
objects in the drawing).

Marion Pietsch
WW Support & Services
Autodesk GIS Product Support

Joel Zimmerman wrote:

> I have a polygon topology that has centroid object data. I want to link the
> topology to an Access 2k table with a link template. When I do so I only get
> some of the centroids linked. The data table only has 13 rows. Each piece of
> the 800+ object data can be linked to one of the table rows. When I attempt
> this I get 51 links and the others cannot be processed. They match exactly.
> When I use the "Convert Object Data to Database Links" tool I get a table
> with 800+ rows. Most of this data is duplicated. I want a lookup table that
> has a One to Many relationship and not a reference table that has a One to
> One relationship.
> Any Ideas?
>
> --
> Joel
> joel@NSPM.harden-assoc.com
> remove the NSPM. to email me directly
Message 3 of 3
Anonymous
in reply to: Anonymous

Joel hi,

I think I have an idea that might be helpful.

When you build your Database, make two tables:
1- The first one will be the table that has in it all the drawing
object's information, including the key field (or fields).

2- The second table will include the information that is added to your
AutoCAD objects.

The two tables can be linked in the way you need: for example, one-to-many.

Then, define a query that includes the needed information from both tables.
Don't forget to include the key fields.

Back in Map you can now link your objects (Just as always) to this query by
defining a new Link Template that is
just like the original one (But a different name, of course).

You can now query your objects on the basis of the information in this
query.
This way you do not have multiple instances of the same information in the
database and it is much easier to update that info.
(Beware: you cannot edit the information in this query from Map, you can
only view it or query by it.)

Good Luck,
Arad

"Marion Pietsch (Autodesk)" wrote in
message news:3BA9DFEF.1F59B650@autodesk.com...
> Joel,
>
> in general you should be able to link 800 objects to 13 rows in the table,
but I
> wouldn't recommend doing this, because for most features to complete a
unique
> key/record is needed.
> Map was not designed to work with 'lookup tables', even if you could use
them
> for querying tasks.
>
> Reading thru the following instructions I starting writing up for using
lookup
> tables for queries in Map might give you some ideas what is
possible/recommended
> and what not even if it won't answer your question exactly.
>
> --------------------------------------
> Imagine you have 2 tables in one MS Access mdb file where only one (called
> 'first table') is linked to drawing objects; the second table (called
'second
> table') is only linked to the first table by a common column.
>
> In Map you can query data also from the second table by using the syntax
> described in the following scenarios in all commands that offer an SQL
> 'Expression' option, for instance in Map > Query > Define Query > Alter
> Properties.
>
> Scenario 1
> You could now query values from the second table in the mdb file by using
the
> following expression:
>
> &SecondTableName.ColumnNameToQuery@LinkTemplateNameForFirstTable
>
> This would just query all entries from the specified column name of the
second
> table, but that's probably not really what you're looking for, because
there's
> no connection to the table that is linked to the obects whereas with a
lookup
> table there's a (one-to-many) relation between the
> tables.
>
> Scenario 2
> To get only the records from the second table queried that are linked to
the
> first one you'd need a column that exists in both tables (with the same
name and
> field type). The expression would then be:
>
>
&SecondTableName.ColumnNameToQuery@LinkTemplateNameForFirstTable.LinkingColu
mnName
>
> Scenario 3
> Now, if the column name that links the 2 tables doesn't have the same name
you
> have to specify the corresponding field names in the expression:
>
>
&SecondTableName.ColumnNameToQuery@LinkTemplateNameForFirstTable.LinkingColu
mnNameInFirstTable.LinkingColumnNameInSecondTable
>
> And finally, if the tables are not in the same scheme and/or catalog you'd
have
> to define it for the second table on the left side of the @:
>
> &Catalog.Scheme.SecondTableName.ColumnNameToQuery@......
>
> Summary:
> This means that you can use lookup tables with all Map functionalities
where SQL
> Expressions are allowed. That works e.g. for reports, but in the drawing
itself
> when working with drawing objects and the DataView the linkage between the
2
> tables is not available for use (for example
> it doesn't work to highlight a row in the lookup table and get all linked
rows
> in the actually linked/first table highlighted, or even more also the
linked
> objects in the drawing).
>
> Marion Pietsch
> WW Support & Services
> Autodesk GIS Product Support
>
> Joel Zimmerman wrote:
>
> > I have a polygon topology that has centroid object data. I want to link
the
> > topology to an Access 2k table with a link template. When I do so I only
get
> > some of the centroids linked. The data table only has 13 rows. Each
piece of
> > the 800+ object data can be linked to one of the table rows. When I
attempt
> > this I get 51 links and the others cannot be processed. They match
exactly.
> > When I use the "Convert Object Data to Database Links" tool I get a
table
> > with 800+ rows. Most of this data is duplicated. I want a lookup table
that
> > has a One to Many relationship and not a reference table that has a One
to
> > One relationship.
> > Any Ideas?
> >
> > --
> > Joel
> > joel@NSPM.harden-assoc.com
> > remove the NSPM. to email me directly
>
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost