changeset 613:99cd44f19e86

Sounding results: Fetch bottleneck_id from bottleneck table by objnam.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 10 Sep 2018 18:07:53 +0200
parents d127856e689d
children be8b79109679
files cmd/soundingresults/main.go
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cmd/soundingresults/main.go	Mon Sep 10 17:48:56 2018 +0200
+++ b/cmd/soundingresults/main.go	Mon Sep 10 18:07:53 2018 +0200
@@ -219,7 +219,9 @@
 				fmt.Fprintln(out, "  depth_reference,")
 				fmt.Fprintln(out, "  point_cloud")
 				fmt.Fprintln(out, ") VALUES (")
-				fmt.Fprintf(out, "  %s,\n", quote(r.m.name))
+				fmt.Fprintf(out,
+					"  (SELECT bottleneck_id from waterway.bottlenecks where objnam = %s),\n",
+					quote(r.m.name))
 				fmt.Fprintf(out, "  '%s'::date,\n", r.m.date.Format("2006-01-02"))
 				fmt.Fprintf(out, "  %s,\n", quote(r.m.depthReference))
 				fmt.Fprintf(out, "  '")