<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI \,sans-serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Thanks for your reply, Even. Maxim is on vacation, so let me try to answer on his behalf.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Good point about the symbol clashes. We weren’t thinking of that yet. Adding an additional namespace prefix seems to be a good idea. We should introduce that option upstream.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Before we implemented our own ODBC wrapper, we checked out existing ones. Indeed, nanodbc seems to be the best maintained wrapper with the most features. However, it does not support batch inserts with data-at-execution
 parameters (<a href="https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/using-arrays-of-parameters?view=sql-server-ver15">https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/using-arrays-of-parameters?view=sql-server-ver15</a>), which
 we consider rather important in a spatial context as the length of geometry values can vary greatly.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We considered contributing, but batch inserts with data-at-execution parameters are poorly supported by ODBC drivers. Of the drivers we tested, we found that only PostgreSQL and SAP HANA support it the way we understand
 the specification. Hence, we preferred to write our own wrapper as the data-at-execution parameters support might be considered a buggy feature.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Yes, the SAP HANA Client (<a href="https://tools.hana.ondemand.com/#hanatools">https://tools.hana.ondemand.com/#hanatools</a>) contains the ODBC driver for SAP HANA (it also contains database connectors for other languages).
 The driver is not required at compile time, it’s only required at runtime if you want to connect to an SAP HANA database.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Can you point us to an example of a GDAL plugin that is offered as download from a GDAL external website? This might be an option, but we would prefer contributing directly to GDAL, of course. Maintaining binary plugin
 versions externally for all the relevant versions/platforms/compilers will probably be difficult.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Would it be sufficient if the OGR SAP HANA driver is reviewed by members of our team? And if that’s not sufficient, what options do we have to find someone who is qualified to do the final review?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks, and best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Stefan</span><span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> gdal-dev <gdal-dev-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Even Rouault<br>
<b>Sent:</b> Friday, August 13, 2021 7:31 PM<br>
<b>To:</b> Rylov, Maxim <maxim.rylov@sap.com>; gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] HANA driver proposal<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Maxim,<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">> “I assume the driver would depend on the ODBC library, and would require users to build
</span><a href="https://github.com/SAP/odbc-cpp-wrapper"><span lang="EN-US">https://github.com/SAP/odbc-cpp-wrapper</span></a><span lang="EN-US"> as the corresponding ODBC driver ?”</span><span lang="EN-US">
</span><o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p><span lang="EN-US">The odbc-cpp-wrapper library is going to be used only during the compilation phase and linked statically, thus end users will get only one dynamic/shared library of the HANA driver.  Hence, no additional actions are required from end users.
 For those who want to compile the GDAL sources with HANA support on their own, the sources of the odbc-cpp-wrapper are needed. However, this step can be omitted if we store a copy of the library in
</span><a href="https://github.com/OSGeo/gdal/tree/master/gdal/third_party"><span lang="EN-US">https://github.com/OSGeo/gdal/tree/master/gdal/third_party</span></a><span lang="EN-US"> like we did in QGIS (see
</span><a href="https://github.com/qgis/QGIS/tree/master/external/odbccpp"><span lang="EN-US">https://github.com/qgis/QGIS/tree/master/external/odbccpp</span></a><span lang="EN-US">).
</span><o:p></o:p></p>
</div>
</blockquote>
<p>I can anticipate potential issues if both GDAL and QGIS have a odbcpp vendorized copy, and that for some reason they differ in versions. That could cause symbol clashes at runtime. Putting the vendorized copy in a dedicated namespace prefix (GDAL::) could
 avoid that.<o:p></o:p></p>
<p>Otherwise, isn't the cpl_odbc.h abstraction good enough ?<o:p></o:p></p>
<p>Side note: are you aware of <a href="https://github.com/nanodbc/nanodbc">https://github.com/nanodbc/nanodbc</a> that is also a C++ wrapper for ODBC ? (Mateusz one of our PSC members was the main developer of it, although I believe he has retired from it)<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p><span lang="EN-US">Note, that any HANA plugin (GDAL/QGIS) also requires the SAP HANA Client (<a href="https://tools.hana.ondemand.com/#hanatools">https://tools.hana.ondemand.com/#hanatools</a>) to be able to connect an SAP HANA database.</span><o:p></o:p></p>
</div>
</blockquote>
<p class="MsoNormal">Is that the ODBC driver for SAP HANA ?<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span lang="EN-US">​Unfortunately, we are not able to answer the remaining raised points</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI ,sans-serif",serif">
</span><span lang="EN-US" style="font-size:10.5pt">as they are beyond our expertise</span><span lang="EN-US">.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto"><span lang="EN-US">Perhaps they should be addressed in a separate dedicated discussion.</span><o:p></o:p></p>
</div>
</blockquote>
<p>Well, if you contribute to GDAL, then that should be in your area of interest and concern :-)<o:p></o:p></p>
<p>I think the main practical issue for this to go forward is for you to find someone who would want to review your contribution.<o:p></o:p></p>
<p>Another option is to propose the OGR SAP HANA driver as a plugin for download from your website.<o:p></o:p></p>
<p>Even<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</body>
</html>