Re: Extracting SQL into resourceStrings...Tool?



"Randy Magruder" <rmagruder@xxxxxxxxxxxx> wrote in message
news:442ae31d$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Johannes Bjerregaard wrote:

If the programming style is consistent,

ROFL->LMAO :) It's hard enough getting a small team to be consistent
let alone a code-inheritance chain that dates back to '96 and God knows
how many developers. It's a mess...I wish I could count on consistency
:)

you could probably use the
Delphi editor's macro recorder to do most of the work.

I often do. But I want to go a step beyond that.

Not sure why you would use resource strings rather than consts, it
doesn't seem like the kind of thing that needs to be localized.

Honestly, I don't care if they are consts or resourceStrings. I just
want the injected SQL OUT of the source files like this.

Randy

I have no help for automatically extracting the SQL; parsing the code with
regular expressions seems like best way to me.

Also, might not be exactly what you want, but if the resource string doesn't
work you might want to read a 3-part series of articles in Delphi Informant
written a few years ago by Rick Spence on creating a component by
subclassing TQuery to store SQL strings in a database and automatically
retrieve them as the TQuery was opened. I remember trying it out with
TDBISAMQueries and thought it was neat. Has advantages over extracting to
resource strings because having the sql in the db itself makes easier to
edit, create versions for different db's, etc. I'm sure there is some
performance hit, but I'm guessing it would be minimal. (Not sure, but the
method in the article could also probably be adopted to get the SQL strings
from resource strings.) Anyway, the code and articles would be available on
the Delphi Informant CD:
http://www.delphizine.com/

-- Herb Sitz


.



Relevant Pages

  • Re: Tracing
    ... When tracing SQL statements from SQLPLUS to see consistent gets and ... such, if the query contains bind variables or constants, how do you ... Here is the general procedure with a different SQL statement (you MUST ... Autotrace and EXPLAIN PLAN will sometimes lie about the actual ...
    (comp.databases.oracle.misc)
  • Re: Generating SQL
    ... >> other code change, just the class definition. ... > Concatentation is not by itself less consistent. ... >> proper SQL, with parameters and data types derived from my classes. ...
    (comp.object)
  • Re: Access 2003 - SQL Server - Records apparently delete but dont
    ... as you have noticed are not consistent ... And there have been arguments for and against using ADO. ... results using ADO between Access and Sql Server. ...
    (comp.databases.ms-access)
  • Re: Syntax help requested for update query
    ... Same results when I tested in A2K2. ... This is consistent ... > because I can't get it to work as a single query in ... >If I use SQL like this: ...
    (microsoft.public.access.gettingstarted)