SQL code generators

The below are excerpts from a couple of websites…


We all know the drill: Don’t reinvent the wheel. Re-use code. Rely on libraries of pre-built code. And yet so few of us do it. One way to avoid “deja code”, that feeling you’d written this algorithm before, is to generate code rather than write it manually. Code generation offers tremendous promise, in terms of both productivity and code quality.

Improve productivity and code quality with QCGU

PL/SQL developers spend lots of time writing the same kind of code over and over again, much of it based on the underlying tables, views and programs with which we are working. To save time, we frequently take a “quick and dirty” approach, which is often incomplete and error-prone.

QCGU offers a new approach: choose a template from the QCGU repository (or build your own) that reflects the pattern of code you want to write. Then run that template for a particular database object (usually a table or a program). QCGU will then generate the code in a fraction of the time you would need to write it yourself.

You can think of QCGU as a “design pattern factory,” allowing you to generate virtually any sort of code you want (not just Oracle PL/SQL!). But of course most developers aren’t going to sit around writing patterns. You will most likely take advantage of QCGU in one of the following ways:

1. Generate table API packages (packages that contain procedures and functions that perform most commonly-needed SQL operations). Specifically, QCGU generated three packages: the Change Package ([tablename]_cp) to perform DML; the Query Package ([tablename]_qp) to perform queries; and the Type Package ([tablename]_tp) to provide pre-defined declaration types. You then call the appropriate program in your application code and skip writing the SQL!

2. Utilize the QCGU error management framework. QCGU utilizes in its table API packages a standard error management package named qd_runtime, which in turn writes to the log table (qd_log) and error tables (qd_err_instance and qd_context). You can use this same generalized error management framework in your own applications.

QCGU is FREEWARE! Quest Software invites you to take advantage of this powerful tool, but it offers no support for this product. Instead, press the Support tab on the top of this page and follow the link to the online community, where other users of QCGU will help you.


Also see:



PS: Note that installing qcgu creates a lot of tables of its own in the schema.

Leave a Reply