Comments in embedded SQL applications

The comments in any application are important for making the application code understandable.

Comments in C and C++ embedded SQL applications

When working with C and C++ applications, SQL comments can be inserted within the EXEC SQL block. For example:

    /* Only C or C++ comments allowed here */
     EXEC SQL
        -- SQL comments or
        /* C comments or */
        // C++ comments allowed here
        DECLARE C1 CURSOR FOR sname;
     /* Only C or C++ comments allowed here */
   

Comments in COBOL embedded SQL applications

When working with COBOL applications, SQL comments can be inserted within the EXEC SQL block. For example:

   *   See COBOL documentation for comment rules
   *   Only COBOL comments are allowed here
       EXEC SQL
       -- SQL comments or
   *   full-line COBOL comments are allowed here
       DECLARE C1 CURSOR FOR sname END-EXEC.
   *   Only COBOL comments are allowed here
  

Comments in FORTRAN embedded SQL applications

When working with FORTRAN applications, SQL comments can be inserted within the EXEC SQL block. For example:

  C     Only FORTRAN comments are allowed here
        EXEC SQL
        + -- SQL comments, and
  C     full-line FORTRAN comment are allowed here
        + DECLARE C1 CURSOR FOR sname
        I=7 ! End of line FORTRAN comments allowed here
  C     Only FORTRAN comments are allowed here
  

Comments in REXX embedded SQL applications

SQL comments are not supported in REXX applications.