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:
To:
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'
)
)
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'
)
)

Comment