|
This seems not to be a problem of GET_CLOB_FROM_FILE, but a problem of our JSON_TABLE Statemen.
What exactly do you want to get returned?
A table like this:
STATE CITY
Alaska Anchorage
Arkansas Stumptoe
Florida Jacksonville
Florida Tampa
Florida Orlando
If so, the SQL Statement must look as follows:
Select *
From JSON_TABLE('{"statecount":3,"states":[
{"state":"Alaska","citycount":1,"cities":["Anchorage","","",""]},
{"state":"Arkansas","citycount":1,"cities":["Stumptoe","","",""]},
{"state":"Florida","citycount":3,"cities":["Jacksonville","Tampa","Orlando",""]}
]}',
'$.states[*]'
Columns(State VarChar(30) path '$.state',
Nested '$.cities[*]'
Columns(City VarChar(30) path '$'))) x
Where City > '';
I added a where condition because several array elements are empty.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
As an Amazon Associate we earn from qualifying purchases.
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.