title: Snap a point to a line and get the line ID
body: <p>I have an Oracle 18c database that has SDO_GEOMETRY tables:</p>
  
  <ul>
  <li>Sidewalk <strong>polyline</strong> table</li>
  <li>Sidewalk inspection <strong>point</strong> table</li>
  </ul>
  
  <hr>
  
  <p>When sidewalk inspection points are created, I want to automatically snap the points to the closest line --and-- insert the line's ID into a column. </p>
  
  <p><a href="https://i.stack.imgur.com/QLFIx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QLFIx.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>I'm not interested in snapping to the line vertices (sidewalk deficiencies/inspections don't necessarily occur at vertices). I need to be able to snap to the closest position along the line (even if it is mid-segment).</li>
  <li>The search tolerance would be 5 metres.</li>
  </ul>
  
  <hr>
  
  <p>Is there a way to do this via an Oracle Spatial/SDO_GEOMETRY insert trigger?</p>
  
  <p><em>(I've poked around in the docs, but I haven't seen anything so far that lends itself to snapping.)</em></p>