• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

SQL Formatter breaks API call

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Formatter breaks API call

    I'm attempting to call an API from my data source using json_table and http_get and the auto formatter is turning into invalid SQL.

    It is going from this:

    Code:
    SELECT
      DISTINCT ordernum,
      custshipdate
    FROM
      json_table(
        qsys2.http_get(
            'https://some.example.url/run/some/api'
        ),
        '$.data' columns(
          ordernum char(8) path 'lax $.order',
          tally char(5) path 'lax $.tally',
          site char(2) path 'lax $.site',
          department char(1) path 'lax $.department',
          datetype char(10) path 'lax $.dateType',
          custshipdate date path 'lax $.mfgDate'
        )
      )
    To:
    Code:
    SELECT
      DISTINCT ordernum,
      custshipdate
    FROM
      json_table(
        qsys2.http_get(
            'https://some.example.url/run/some/api'
        ),
        '$.data' columns(
          ordernumchar(8) path 'lax $.order',
          tallychar(5) path 'lax $.tally',
          sitechar(2) path 'lax $.site',
          departmentchar(1) path 'lax $.department',
          datetypechar(10) path 'lax $.dateType',
          custshipdatedatepath 'lax $.mfgDate'
        )
      )
    ​

  • #2
    Hi,

    I assume you're not using the latest version, as the latest version addresses this issue. Could you confirm the exact version you're experiencing this on?

    Thanks!​

    Comment


    • #3
      You are correct. We are on version 6.3.20250910.0. We do have the latest version in our regression testing environment. I went and checked it there and it was not an issue. I apologize for not checking that before I posted.

      Thank you.

      Comment

      Working...
      X