Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15535

CONNECT JSON Table Type

    XMLWordPrintable

    Details

      Description

      I have found a couple of issues on webpage https://mariadb.com/kb/en/library/connect-json-table-type/

      Section: Alternate Table Arrangement
      [
      [56, "Coucou", 500.00],
      [[2,0,1,4], "Hello World", 2.0316],
      ["1784", "John Doo", 32.4500],
      [1914, ["Nabucho","donosor"], 5.12],
      [7, "sept", [0.77,1.22,2.01]],
      [8, "huit", 13.0],
      ]

      insert into xjson values(25, 'Breakfast', 1.414);
      Returns: SQL Error (1296): Got error 174 'Unexpected ',]' near ],' from CONNECT

      Solution: Remove comma after the last JSON item [8, "huit", 13.0]

      Section: CRUD operations on JSON tables
      CREATE TABLE jauthor (
      FIRSTNAME CHAR(64),
      LASTNAME CHAR(64))
      ENGINE=CONNECT table_type= JSON File_name='biblio3.json' option_list='Object=2.AUTHOR';

      select * from jauthor;
      Returns: SQL Error (1296): Got error 174 'Cannot find array value 2' from CONNECT

      Solution: Either option_list='Object=1.AUTHOR' or option_list='Object=2.AUTHOR, Base=1'

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              greenman Ian Gilfillan
              Reporter:
              erchbox Eduardo Reyes
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: