2. Embedded SQL for C : Preprocessor Operation : Coding Requirements for Embedded SQL Programs : Comments Embedded in C Output
 
Share this page                  
Comments Embedded in C Output
Each embedded SQL statement generates one comment and few lines of C code. You may find that the preprocessor translates 50 lines of embedded SQL into 200 lines of C. This can confuse you if you are trying to debug the original source code. To facilitate debugging, a comment corresponding to the original embedded SQL source precedes each group of C statements associated with a particular statement. (Note that a comment precedes only executable embedded SQL statements.) Each comment is one line long and informs the reader of the file name line number and the type of statement in the original sources file.
The ‑# flag to the esqlc command makes the C comment a C compiler directive, causing any error messages generated by the C compiler to refer to the original file and line number; this can be useful in some cases.
One consequence of the generated comment is that you cannot comment out embedded statements by putting the opening comment delimiter on an earlier line. You have to put the delimiter on the same line, before the exec word, to cause the preprocessor to treat the complete statement as a C comment.