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

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

5 REPLIES 5
Reply
Message 1 of 6
TimGIS
279 Views, 5 Replies

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

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
5 REPLIES 5
Message 2 of 6
Anonymous
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

Message 3 of 6
Anonymous
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
Message 4 of 6
TimGIS
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???
Message 5 of 6
Anonymous
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
>
Message 6 of 6
TimGIS
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

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

Post to forums  

Autodesk Design & Make Report