Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For best performance, should get a look at our <a href="http://blog.synopse.info/post/2011/07/09/SynDBOracle:-Open-Source-native-Oracle-access" rel="nofollow noreferrer">Open Source direct access to Oracle</a>.</p> <p>If you are processing a lot of TQuery, without using the DB components, we have a dedicated pseudo-class to use direct OCI connection, as such:</p> <pre><code> Q := TQuery.Create(aSQLDBConnection); try Q.SQL.Clear; // optional Q.SQL.Add('select * from DOMAIN.TABLE'); Q.SQL.Add(' WHERE ID_DETAIL=:detail;'); Q.ParamByName('DETAIL').AsString := '123420020100000430015'; Q.Open; Q.First; // optional while not Q.Eof do begin assert(Q.FieldByName('id_detail').AsString='123420020100000430015'); Q.Next; end; Q.Close; // optional finally Q.Free; end; </code></pre> <p>And I've added some unique access via a late-binding Variant, to write direct code as such:</p> <pre><code>procedure Test(Props: TOleDBConnectionProperties; const aName: RawUTF8); var I: ISQLDBRows; Customer: Variant; begin I := Props.Execute('select * from Domain.Customers where Name=?',[aName],@Customer); while I.Step do writeln(Customer.Name,' ',Customer.FirstName,' ',Customer.Address); end; var Props: TOleDBConnectionProperties; begin Props := TSQLDBOracleConnectionProperties.Create( 'TnsName','UserName','Password',CODEPAGE_US); try Test(Props,'Smith'); finally Props.Free; end; end; </code></pre> <p>Note that all OleDB providers are buggy for handling BLOBs: Microsoft's version just do not handle them, and Oracle's version will <a href="https://stackoverflow.com/questions/6147274/is-oraoledb-provider-in-net-unreliable-on-clob-fields">randomly return null for 1/4 of rows</a>...</p> <p>On real database, I found out our direct OCI classes to be 2 to 5 times faster than the OleDB provider, without the need to install this provider. You can even use the <a href="http://www.oracle.com/technetwork/database/features/instant-client" rel="nofollow noreferrer">Oracle Instant Client</a> provided by Oracle which allows you to run your applications without installing the standard (huge) Oracle client or having an ORACLE_HOME. Just deliver the dll files in the same directory than your application, and it will work.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload