IBM i

 View Only

COBOL use JSON_TABLE syntax ERROR SQL0104

  • 1.  COBOL use JSON_TABLE syntax ERROR SQL0104

    Posted Fri April 29, 2022 09:02 AM
    The following embedded SQL statement work in RPGLE, but doesn't work with COBOL under OS V7R2 and V7R3
    EXEC SQL
    select name, street, city, state, postal
    into :name, :street,
    :city, :state, :postal
    from JSON_TABLE(systools.HTTPGETCLOB(:uri,
    :header),
    'lax $'
    COLUMNS (
    NAME VARCHAR(30) CCSID 937 PATH 'lax $.NAME',
    STREET VARCHAR(30) CCSID 937 PATH 'lax $.STREET',
    CITY VARCHAR(30) CCSID 937 PATH 'lax $.CITY',
    STATE CHAR(25) PATH 'lax $.STATE',
    POSTAL CHAR(5) PATH 'lax $.POSTAL'
    )
    ) x
    END-EXEC.
    and got syntax checking error SQL0104

     Additional Message Information

    Message ID . . . . . . : SQL0104 Severity . . . . . . . : 30
    Message type . . . . . : Diagnostic

    Message . . . . : Token 'lax $.NAME' was not valid. Valid tokens:
    <HEXSTRING> <CHARSTRING> <GHEXSTRING> <GRAPHSTRING>.
    Cause . . . . . : A syntax error was detected at token 'lax $.NAME'. Token
    'lax $.NAME' is not a valid token. A partial list of valid tokens is
    <HEXSTRING> <CHARSTRING> <GHEXSTRING> <GRAPHSTRING>. This list assumes that
    the statement is correct up to the token. The error may be earlier in the
    statement, but the syntax of the statement appears to be valid up to this
    point.
    Does it COBOL compiler issue ? Whose PTF's do I need to install ?


    ------------------------------
    Vengoal Chang
    ------------------------------