I am trying to build a SQL command to be used in a webservice. The command
will have nested JSON objects.
I am unable to figure how to structure the statement. I have viewed a
number of examples, but they are all different and fail to run when I try
them.
Here is my example:
Select json_object(
key 'CMSNumber' value q100.kcms# -- value "CMSNumber"
, key 'EnteredBy' value q100.kendt -- value "EnteredBy"
, key 'Currency' value
case when ccrcd = '' then 'USD'
else ccrcd
end
-- this is the object within the object
, 'ErrorUsers' value json_object (
key 'User' value ke1usr absent on null
, key 'User' value ke2usr absent on null
, key 'User' value ke3usr absent on null
, key 'User' value ke4usr absent on null
, key 'User' value ke5usr absent on null
)
, key 'SalesmanNumber' value ksalno
, key 'SalesmanName' value smnam
from ....
Can anyone assist with what I am doing wrong?
Thanks
Darryl Freinkel
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.