<div dir="ltr">On Tue, Oct 18, 2011 at 23:07, Boris shtrasman <span dir="ltr"><<a href="mailto:borissh1983@gmail.com">borissh1983@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi ,<br>
<br>
Today I chatted with an experienced person and we had our<br>
disagreements between database types and an interesting issue rose up<br>
about using Native Api or ODBC ,<br>
from what I experienced in the last years I can't find any good reason<br>
why not use ODBC:<br>
<br>
Pro:<br>
1. using ODBC is more prone to api change.<br>
2. it is easier (I think) to maintain ODBC based code , I've seen code<br>
based with more then 15 years and it is still maintainable, and the<br>
code stores db back compatibility (from SQL 2000 to SQL 2010).<br>
3. didn't find any indication for performance penalty more then 10%<br>
(didn't see that just found this number in a written benchmark a<br>
fellow did few years ago).<br>
4. don't violate GPL if your using a driver and just using the DB as<br>
storage backed (*IANAL).<br>
<br>
so as long you stick to good SQL (ANSI) code your pretty safe (yes I<br>
know that the dbs have wonderful extensions the problem they have the<br>
tendency to change api and not support what the others have)<br>
<br>
But I'm pretty sure there situation when you should avoid using ODBC<br>
(the problem I don't what they are).<br>
<br>
Do you have any suggestions when should I use native api instead of ODBC ?<br>
<br></blockquote><div><br>Boris, you'ved missed a lot of what I have said in the conversation, as you see only narrow sight on things.<br><br>If you take Ruby, Python and even Delphi/FPC they all binding to the official API rather then ODBC.<br>
They use so because ODBC as you mentioned is very limited.<br>For example if I want to use stored procedures, udf, event driven work (Firebird and PostgreSQL support TCP based events that you can trigger on things), capture exceptions (user defined ones) etc... Well, using ODBC is almost impossible for some of the things. It is more generic way of using databases.<br>
<br>When all I require is simple connection to the database and run simple tasks, it might provide good job. But when you are starting to have more demands, or do not wish to place your whole data logic in your application (amm MySQL anyone ?), then how ODBC can help you with that ?<br>
</div></div><br>Ido<br></div>