title: How to use DB2 version 10 SQL TO generate a query into JSON output?
body: <p>I'm using DB2 - 10</p>
  
  <p>Im trying to generate a QUERY with SQL to pull certain data values from tables,
  I'm then concatenating within the SQL CODE with the JSON code prior and post the DATA after to finalize the output in JSON code.</p>
  
  <p>SCRIPT/QUERY:</p>
  
  <pre><code> SELECT
      '","truck": {"number": "' || LS.LS_POWER_UNIT ||
      '","type": "TR"*"vinNumber": "' || P.VIN ||
      '","licensePlates": [{"number": "' || P.LIC_1 ||
      '","stateProvince": "' || P.LIC_1_PRST
      TRUCK 
  </code></pre>
  
  <p>RESULT:</p>
  
  <blockquote>
    <p>","truck": {"number": "1234","type": "TR","vinNumber":
    "123456VINNUMBER",""licensePlates": [{"number":
    "ON1234","stateProvince": "ON"}]</p>
  </blockquote>
  
  <p><em>Please note that's just a sample from my entire code, there are probably missing syntax but it's complete in the rest of my code.</em></p>
  
  <p>However upon researching i've found out other DB2 versions have a JSON_Object mine does not however, was wondering if someone was fluent in DB2 10 to help me utilize some sort of JSON_OBJECT similar to the following example found in other DB2 VERSIONS.</p>
  
  <pre><code>select json_object ('id' value id, 
                      'name' value last_name, 
                      'office' value office_number) 
  from empdata;
  </code></pre>
  
  <p>RESULT:</p>
  
  <pre><code>{"id":901,"name":"Doe","office":"E-334"}
  {"id":902,"name":"Pan","office":"E-216"}
  {"id":903,"name":"Jones","office":"E-739"}
  {"id":904,"name":"Smith","office":null}
  </code></pre>