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

Make "for" sentence support JSON arrays

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • N/A
    • JSON
    • None

    Description

      Hello.

      Is it possible to make "for" sentece support JSON arrays? For example:

      declare json_string varchar(1024) default '[
          {"rdbms":"MySQL/MariaDB","tag":"Rocks!"},
          {"rdbms":"Oracle Database","tag":"It\'s fine"},
          {"rdbms":"IBM DB2","tag":"Available in z/OS"},
          {"rdbms":"Microsoft SQL Server","tag":"No comments"}
      ]';
       
      for rdbms in json_query(json_string, '$') do
         -- Do something with current iteration's object.
         select json_value(rdbms, '$.rdbms'), json_value(rdbms, '$.tag');
      end for;
      
      

      Regards.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              null_pointer_00 Rubén
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.