× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I do not use JSON_ object functions but when I need to embed case statement the results are essentially a result column. So that means when I need to connect it to other values I need to concatenate them together.
" // End
'product' "
Are these two pieces to be part of a single value in a column or are they two distinct columns? It looks like you might be missing a comma.

-Matt


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Hudson, Ron
Sent: Wednesday, May 15, 2019 7:04 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: SQL syntax error with CASE statement

The code snippet below works with the 2nd case statement commented out. The first case statement works without issues.

With the 2nd case statement uncommented, the next line (below) is highlighted with error "Keyword VALUE not expected. Valid tokens: END".
'jurisdictionOverrides' value JSON_ARRAY( Any ideas?

'lineItems' value JSON_ARRAYAGG(
CASE when ORPART > ' ' then
JSON_OBJECT(
// CASE when :PST_Exmp = 'true' then
'jurisdictionOverrides' value JSON_ARRAY(
JSON_OBJECT(
'deductionOverride' value JSON_OBJECT(
'exemptOverride' value JSON_OBJECT(
'value' value 100
)
),
'jurisdictionLevel' value 'PROVINCE'
)
),
// Else
// End
'product' value JSON_OBJECT(
'productClass' value trim(VProdClass),
'value' value trim(ORPART)),
'quantity' value JSON_OBJECT(
'value' value ORORSH),
'unitPrice' value ORORSL,

Thanks!

Ron

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=ApOJGltFoa6cb0JL1a_GS5oVoPFZqtzMrA-XnL2XhIY&s=cu5SWrlMlYp-GNAgCK8QTcXvvV1P0fmtA3J1spwr1mE&e=
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=ApOJGltFoa6cb0JL1a_GS5oVoPFZqtzMrA-XnL2XhIY&s=oS4TJtQChCq92y5ze09vGiobGBuyuY_TrHfu6kPHCrc&e= .

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=ApOJGltFoa6cb0JL1a_GS5oVoPFZqtzMrA-XnL2XhIY&s=mjYiMgwy2yf_Fqv-Qmryp6zPgXaQlKcBDPDmawYiQOY&e=

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.