Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
--f46d04339f0248b9fc04d9b33b27
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir="ltr"><div><div><div><div>I tried with the escape beckslash \ (that is \:\:box3d) but the error was the same.<br></div>Then I tried to change the cast syntax as suggested by Mateusz and the query worked.<br></div>
Could be a good idea to add an escape strategy like that one of the backslash (\) for parsing the colons. <br>Do I add the feature request on github?<br><br></div>thanks for the replies, <br></div>Bruno<br></div><div class="gmail_extra"> <br><br><div class="gmail_quote">2013/4/6 Vadim Zeitlin <span dir="ltr">&lt;<a href="mailto:vz-***@zeitlins.org" target="_blank">vz-***@zeitlins.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, 6 Apr 2013 14:02:09 +0100 Mateusz Loskot &lt;<a href="mailto:***@loskot.net">***@loskot.net</a>&gt; wrote:<br>
<br>
ML&gt; &gt; the application gives my the following error:<br>
ML&gt; &gt;<br>
ML&gt; &gt; &quot;Wt: fatal error: ERROR: syntax error at or near &quot;&quot;$1&quot;&quot;<br>
ML&gt; &gt; LINE 1: ...etsrid(&#39;BOX3D(15.0118 37.4667, 15.2118 37,6667)&#39;::$1, 4326) ...<br>
ML&gt; &gt;<br>
ML&gt; &gt; the error is given in place of $1 that in the query is ::box3d. Why? there<br>
ML&gt; &gt; was this traslation?<br>
ML&gt;<br>
ML&gt; I haven&#39;t tested your query in action, but I suppose there may be conflict<br>
ML&gt; between casting operators and how SOCI parses query to handle<br>
ML&gt; placeholders bound by name:<br>
ML&gt;<br>
ML&gt; <a href="http://soci.sourceforge.net/doc/3.2.0/exchange.html#bind_name" target="_blank">http://soci.sourceforge.net/doc/3.2.0/exchange.html#bind_name</a><br>
<br>
 FWIW the code in PostgreSQL backend clearly tries to detect the cast<br>
operators, there are even several cases for this there.<br>
<br>
ML&gt; &gt; Maybe is the double colons that gives the problem? How<br>
ML&gt; &gt; I can fix? How to pass a colon in the sql string?<br>
ML&gt;<br>
ML&gt; Can you try the alternative [1], SQL conformant, syntax for the cast:<br>
ML&gt;<br>
ML&gt; SetSRID(CAST(&#39;BOX3D(15.0118 37.4667, 15.2118 37,6667)&#39; AS box3d), 4326)<br>
<br>
 

Loading...