-2

I have a JSON structured like that ...

{
   "market_order_line_details__c":[
      {
         "PriceItem__r.Catalog_Item__r.Parent_Catalog_Item__r.Parent_Catalog_Item__r.Calendar__r":{
            "CalendarTypeID__c":4,
            "CalendarTypeName__c":"Example"
         },
         "PriceItem__r.Catalog_Item__r.Parent_Catalog_Item__r":{
            "EstimatedDailyAvails__c":"YYYNNYN",
            "Catalog_Display_Name_2__c":"Program Shortname"
         },
         "PriceItem__r.Catalog_Item__r":{
            "ProductionID_Formula__c":123,
            "FormatID__c":456,
            "Catalog_Display_Name_2__c":"Format Shortname",
            "Channel_ID_Formula__c":472,
            "ProgramID_Formula__c":351,
            "DaypartID_Formula__c":901,
            "Customized__c":"Y",
            "Media_Types__c":"PayTV"
         },
         "PriceItem__r.Price_List__r":{
            "External_ID__c":"Example",
            "Currency__c":"Example",
            "Version__c":"1"
         },
         "PriceItem__r.":{
            "Short_Name__c":"Example",
            "isBonificado__c":"Y",
            "isBonificadoExtra__c":"Y"
         }
      }
   ]
}


This code works fine ...

SELECT PriceItem__r.* 
FROM t3, 
     JSON_TABLE(json_col, '$.market_order__c.market_order_line__c[*].market_order_line_details__c[*].PriceItem__r' COLUMNS (
                Short_Name__c Char(20) PATH '$.Short_Name__c',
                isBonificado__c Char(20) PATH '$.isBonificado__c',
                isBonificadoExtra__c Char(20) PATH '$.isBonificadoExtra__c')
     ) PriceItem__r;  
...

But I can't get this one ... "PriceItem__r.Price_List__r"

Any ideas ?

  • Thanks Jesse_b , is correct now – user2425924 Oct 5 at 20:17
0

Solved ! Just to put double quotes on the complex item ...

SELECT Price_List__r.* 
FROM t3, 
     JSON_TABLE(json_col, '$.market_order__c.market_order_line__c[*].market_order_line_details__c[*]."PriceItem__r.Price_List__r"' COLUMNS (
                External_ID__c Char(20) PATH '$.External_ID__c',
                Currency__c Char(20) PATH '$.Currency__c',
                Version__c Char(20) PATH '$.Version__c')
     ) Price_List__r;     

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.