DLCOMMENT

The DLCOMMENT function returns the comment value, if it exists, from a DataLink value.

Read syntax diagramSkip visual syntax diagramDLCOMMENT (DataLink-expression)
DataLink-expression
An expression that results in a value with a built-in DataLink data type.

The result of the function is VARCHAR(254). If the argument can be null, the result can be null; if the argument is null, the result is the null value.

The CCSID of the character string is the same as that of DataLink-expression.

Examples

  • Prepare a statement to select the date, the description and the comment from the link to the ARTICLES column from the HOCKEY_GOALS table. The rows to be selected are those for goals scored by either of the Richard brothers (Maurice or Henri).
      stmtvar = "SELECT DATE_OF_GOAL, DESCRIPTION, DLCOMMENT(ARTICLES)
                        FROM HOCKEY_GOALS
                        WHERE BY_PLAYER = 'Maurice Richard' 
                        OR BY_PLAYER = 'Henri Richard' ";
      EXEC SQL PREPARE HOCKEY_STMT FROM :stmtvar;
  • Given a DataLink value that was inserted into column COLA of a row in table TBLA using the scalar function:
      INSERT INTO TBLA
        VALUES (DLVALUE('http://dlfs.almaden.ibm.com/x/y/a.b','URL','A comment'))
    
    then the following function operating on that value:
      SELECT DLCOMMENT(COLA)
        FROM TBLA
    Returns the value 'A comment'.