36.17. Internals#
This section explains howECPG works internally. This information can occasionally be useful to help users understand how to useECPG.
The first four lines written byecpg
to the output are fixed lines. Two are comments and two are include lines necessary to interface to the library. Then the preprocessor reads through the file and writes output. Normally it just echoes everything to the output.
When it sees an Variable substitution occurs when a symbol starts with a colon ( The most important function in the library is The arguments are: This is the line number of the original line; used in error messages only. This is theSQL command that is to be issued. It is modified by the input variables, i.e., the variables that where not known at compile time but are to be entered in the command. Where the variables should go the string contains Every input variable causes ten arguments to be created. (See below.) An Every output variable causes ten arguments to be created. (See below.) These variables are filled by the function. AnEXEC SQL
statement, it intervenes and changes it. The command starts withEXEC SQL
and ends with;
. Everything in between is treated as anSQL statement and parsed for variable substitution.:
). The variable with that name is looked up among the variables that were previously declared within aEXEC SQL DECLARE
section.ECPGdo
, which takes care of executing most commands. It takes a variable number of arguments. This can easily add up to 50 or so arguments, and we hope this will not be a problem on any platform.?
.ECPGt_EOIT
#enum
telling that there are no more input variables.ECPGt_EORT
#enum
telling that there are no more variables.