one-to-many join type multiple

Stephen Lime steve.lime at dnr.state.mn.us
Fri Jan 28 22:50:46 EST 2000


Paul: The JOIN template is just about like any other query tempate except that it can only contain replacement strings for the columns present in the joined table. So, if dres010.dbf
contains the fields d_site_id, date and comments then the template:

  <li> Record [D_SITE_ID] ([DATE]): [COMMENTS]<br>

Will print a formatted line for each lab report for the well. The templates can also contain javascript that might be used to build a collection of js objects that could be used to do rudimentatry analysis, populate a graphing applet or whatever. Join header and footers can be used to add opening and closing tag sequences around a set of joined results. For example, to center the above example use a header containing "<center>" and a footer containing "</center>". In general join templates are real small (couple of bytes) files.

Hope this helps. Let me know if it doesn't.

Steve

<<< Paul Cedfeldt <pcedfeldt at crrel.usace.army.mil>  1/27  3:21p >>>
Hello,

I've been trying, with only partial success, to get a shapefile
connected to an external dbf with a one-to-many join.  When clicking on
a well on a map, I would like all lab records for that well (contained
in dres010.dbf) to display.  

The join works, but when a well is clicked the template results.html
only shows info for the last matching record from dres010 for that
well.  I imagine this has something to do with the join template
otmjoin.html, which should be processed once for each record according
to the docs, but otmjoin.html is currently empty since I'm not quite
sure what should be in there.

Any ideas or examples would be greatly appreciated....

Thanks,

-Paul 

-------h.map----------------

LAYER
  NAME well
  DESCRIPTION "Wells"
  TYPE point
  STATUS on
  DATA well
  TOLERANCE 5
  QUERY
    TEMPLATE results.html
    JOIN
      NAME labs
      TABLE /free/haines/d_res010.dbf
      FROM holp
      TO d_site_id
      TYPE multiple 
      TEMPLATE otmjoin.html
    END    
  END
END

------results.html---------

<HTML>
<body bgcolor=#FFFFFF>

Result [rn] <b
<p>
<br>Sample Num: [K_SAMPLE]
<br>Site AP Number: [D_SITE_ID]
<br>Lab Sample #: [K_LABSAMPI]
<br>
</HTML>




More information about the mapserver-users mailing list