Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
221 views
in Technique[技术] by (71.8m points)

Append new properties to existing JSON object in SQL

I have the following json

{
   "GlobalLimit":100.0,
   "BonusConfigurations":[
      {
         "BonusId":1,
         "BonusAmount":{
            "Amount":0,
            "CurrencyId":"USD"
         },
         "Limit":25.0,
         "TransactionType":"Promotion",
         "TransactionSubtype":"Unknown",
         "CashBackPercentage":2
      }
   ]
}

I want to inject new properties into every item in the BonusConfigurations array to get something like this in sql.

{
   "GlobalLimit":100.0,
   "BonusConfigurations":[
      {
         "BonusId":1,
         "BonusAmount":{
            "Amount":0,
            "CurrencyId":"USD"
         },
         "Limit":25.0,
         "TransactionType":"Promotion",
         "TransactionSubtype":"Unknown",
         "CashBackPercentage":2,
         "InternalDescription":"THIS IS THE NEW CAMPAIGN"
      }
   ]
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...