Infrastructure Map Server General Discussion

Infrastructure Map Server General Discussion

Reply
Distinguished Contributor
TimGIS
Posts: 145
Registered: ‎07-20-2003
Message 1 of 6 (119 Views)

Can you use SQL for Labels definitions in the Name Column?????

119 Views, 5 Replies
06-26-2003 03:18 AM
Is it possible to use regular SQL statements in the Name Field ?

I am trying to label piping (WIDTH x HEIGHT) only if SHAPE = ELIPTICAL, otherwise label only WIDTH.

I HAVE A FIXED DATABASE STRUCTURE AND CANNOT ADD NEW FIELDS.

Thanks Folks

Tim
*Morsell, Andy
Message 2 of 6 (119 Views)

Re: Can you use SQL for Labels definitions in the Name Column?????

06-26-2003 03:52 AM in reply to: TimGIS
You could do this a couple of ways.  First,
you can create two layers, one with a Where clause based on the secondary table
where SHAPE like 'eliptical' and the other where SHAPE not like
'eliptical'.  Each layer would have it's own Name definition as you
wish.  The other would be to build a Query or View in your database that
applies your criteria and builds a Name statement in the query.  Then, link
your layer to the Query and point your Name to this in your single layer
definition.

 

I'm sure there are other ways, but thought these
might help get you going.

 


--
Andy Morsell, P.E.
Spatial
Integrators, Inc.

href="http://www.spatialgis.com">http://www.spatialgis.com



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Is
it possible to use regular SQL statements in the Name Field ?

I am trying to label piping (WIDTH x HEIGHT) only if SHAPE = ELIPTICAL,
otherwise label only WIDTH.

I HAVE A FIXED DATABASE STRUCTURE AND CANNOT ADD NEW FIELDS.

Thanks Folks

Tim

*Card, James
Message 3 of 6 (119 Views)

Re:

06-26-2003 04:58 AM in reply to: TimGIS
On Thu, 26 Jun 2003 11:52:40 -0700, Andy Morsell
wrote:

> You could do this a couple of ways.  First, you can create two layers,
> one with a Where clause based on the secondary table where SHAPE like
> 'eliptical' and the other where SHAPE not like 'eliptical'.  Each layer
> would have it's own Name definition as you wish.  The other would be to
> build a Query or View in your database that applies your criteria and
> builds a Name statement in the query.  Then, link your layer to the Query
> and point your Name to this in your single layer definition.

It may also be possible, depending on the database and the ODBC drivers in
use, to include a CASE structure in the query.

CASE SHAPE WHEN ELIPTICAL THEN WIDTH + 'x' + HEIGHT
WHEN CIRCULAR THEN DIAMETER
ELSE WIDTH
END AS Size

--
James Card
Distinguished Contributor
TimGIS
Posts: 145
Registered: ‎07-20-2003
Message 4 of 6 (119 Views)

Re:

06-26-2003 05:06 AM in reply to: TimGIS
Unfortunatly I cannot place Query Tables in the Database and 2 feature classes or layers is also unacceptable.
I am using SQL Server.

I am looking for a way to put in the SQL Statement in the name column.
So far I have IIF(SHAPE = "ELIP", (str(WIDTHMM)) ' x ' (str(HEIGHTMM)), WIDTHMM)

But it doesnt like = or <> or even like and unlike???
*Friedrich, Scott
Message 5 of 6 (119 Views)

Re: Can you use SQL for Labels definitions in the Name Column?????

06-26-2003 08:02 AM in reply to: TimGIS
SQL Server is the problem here. I can use IIF's with Access without any
problems, but SQL Server is an issue. If memory serves me right, I think I
may have switched drivers. If you are using the Microsoft OLEDB Provider
for SQL, try creating a DSN and use Microsoft OLEDB for ODBC - or maybe it
was vice-versa. I hope that helps..

Scott




"Timp" wrote in message
news:f1723fa.-1@WebX.maYIadrTaRb...
> Is it possible to use regular SQL statements in the Name Field ?
> I am trying to label piping (WIDTH x HEIGHT) only if SHAPE = ELIPTICAL,
otherwise label only WIDTH.
>
> I HAVE A FIXED DATABASE STRUCTURE AND CANNOT ADD NEW FIELDS.
>
> Thanks Folks
>
> Tim
>
Distinguished Contributor
TimGIS
Posts: 145
Registered: ‎07-20-2003
Message 6 of 6 (119 Views)

Re:

06-26-2003 09:39 PM in reply to: TimGIS
I cannot change the structure of the connections or use ODBC paths.

If Access can do the SQL Server must be able to.... Its just a matter of syntax.

Thanks Scott, James
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.