Re: Idea of SQL integration



Frenk wrote:
After almost full-time DB programming, I was thinking about how to
integrate RDBMS & Delphi. I am wondering why isn't possible to solve
this issues like compiler directive e.g. ASM. We all know that there
is no general solution for multiple DB vendors (sas for multiple
CPU-s too). Isn't just a great idea like this:

I don't know. It will be problematic to adopt it to alle the db systems flying around.

I use a very simple approach. My central datamodule has a function called NewQuery. It gets a SQL statement and another parameter (optional): Open, Execute, ExecuteAndFree. The function creates the query object (mostly a TDBISAMQueryExt), sets session, database etc, adds the SQL command and does what the parameter say. Easy enough to use for me, it's everywhere in my application. And yes, that's a place where I use with:

with MainDataModule.NewQuery('SELECT COUNT(*) AS RecCount FROM Customers', nqOpen) do begin
try
Result := FieldByName('RecCount').AsInteger;
finally
Free;
end;
end;

Ralf

.



Relevant Pages

  • Re: Executing a select statement multiple times?
    ... If this is the same SQL statement, then you could just load data into ... DataSet once and use this data in a multiple places. ... > I want to execute this multiple times and populate a collection. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Stored Procedure woes!!
    ... > The problem is that I'm using a complex sql statement with multiple ... unions. ... > How can I execute the SP within a sql statement?? ...
    (microsoft.public.sqlserver.programming)
  • Re: tkprof interpreatation question
    ... library cache--Hard parse) ... Misses in library cache during execute (Misses while about to execute ... closes a cursor and then reopened a cursor with the same SQL statement ...
    (comp.databases.oracle.server)
  • Re: Optimizing inline view
    ... Mike C wrote: ... Can you verify that the SQL statement that ... I updated the statistics on this table and the thing ... If you are still having problems, execute the three ALTER SESSION ...
    (comp.databases.oracle.misc)
  • Re: newbie, getting cost plan
    ... I want to get the -real- cost and plan of an sql statement, ... assume that you can execute the SQL statement in question in SQL*Plus, ... However, be aware that this dilutes the information in the trace file, ...
    (comp.databases.oracle.server)