表内の JSON データの更新

JSON2BSON 関数を使用して、表内の JSON データを更新することができます。

プロシージャー

表内の JSON データを更新するには、次のようにします。

  1. JSON 列から JSON データを照会して取得します。
  2. JSON 列の内容を変更します。
  3. 更新した列の値を表にプッシュするには、JSON2BSON 関数を指定して UPDATE SQL ステートメントを実行します。

次の例は、表内の JSON ドキュメントを更新します。
UPDATE CLAIMS SET CALL_RECORDS = SYSTOOLS.JSON2BSON('{"calls": [ 
                                                     {"dateOfCall": "2014-02-26",
                                                      "associate": "Steven Barnes",    
                                                      "conversationNotes": "Customer provided details of accident 
                                                      and witness contact information.  Stated that her local 
                                                      agent was unavailable."},
                                                     {"dateOfCall": "2014-02-29",
                                                      "associate": "Paula Garcia",
                                                      "conversationNotes": "Client asked about status of the 
                                                      damage estimate."}],
                                                      "satisfactionSurveyResult":"needs improvement" }');