SQL texts generated by the compiler

The Genero BDL compiler provides an option to extract static SQL statements from .4gl sources.

The fglcomp compiler parses the static SQL statements and modifies them before writing the resulting SQL text to the .42m module.

To extract all static SQL statements from a source module, use the -S option of fglcomp:

Example

MAIN
  DEFINE cnt INTEGER
  DEFINE c_name VARCHAR(50)
  DATABASE stock 
  SELECT COUNT(*) INTO cnt
    FROM customer
   WHERE customer.cust_name = c_name 
END MAIN
$ fglcomp -S test.4gl 
test.4gl^5^SELECT COUNT(*) FROM customer WHERE cust_name = ?