Я пытаюсь прочитать данные из JSON и сохранить их в БД Oracle.
Я использую приведенный ниже код для чтения данных JSON, но получаю сообщение об ошибке «ORA-01704: string literal too long».
with json as (select to_clob('[
{
"Identifier": "999999999999999999999",
"Item_Document": "<item>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n<creationDateTime>2019-02-22T09:30:47Z</creationDateTime>\n <documentStatusCode>ORIGINAL</documentStatusCode>\n <documentActionCode>ADD</documentActionCode>\n <itemIdentification>\n <entityIdentification>HM0108775015187006</entityIdentification>\n </itemIdentification>\n<tradeItemIdentification>\n <gtin>00000000000000</gtin>\n </tradeItemIdentification>\n <description languageCode=\"en\" descriptionType=\"Short\">S-TOP BL XL</description>\n <description languageCode=\"en\" descriptionType=\"Long\">STRAP TOP BLACK XL</description>\n <countryOfOrigin>BD</countryOfOrigin>\n <tradeItemBaseUnitOfMeasure>EA</tradeItemBaseUnitOfMeasure>\n <itemHierarchyInformation>\n <hierarchyLevelIdentifier>SKU</hierarchyLevelIdentifier>\n <ancestry>\n <hierarchyLevelIdentifier>OPTION</hierarchyLevelIdentifier>\n <memberIdentifier>HM0108775015187</memberIdentifier>\n </ancestry>\n </itemHierarchyInformation>\n <tradeItemMeasurements>\n <size>\n <descriptiveSize languageCode=\"en\">XL</descriptiveSize>\n <sizeCode sizeCodeListCode=\"2\">6</sizeCode>\n</size>\n</tradeItemMeasurements>\n</item>",
"Number": "1"
}
]') as doc From Dual)
Select Item_Identification ,
Item_Document,
Doc_Seqno
From json_table( (Select Doc From Json) , '$[*]'
Columns ( Item_Identification Path '$.Identifier',
Item_Document Path '$.Item_Document',
Doc_Seqno Path '$.Number'
) )
Сообщение об ошибке:
ORA-01704: слишком длинный литерал строки
01704. 00000 - "слишком длинный литерал строки"
* Причина: строкалитерал длиннее 4000 символов.
* Действие: используйте строковый литерал не более 4000 символов.Более длинные значения можно вводить только с помощью переменных связывания.