Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10764 PL/SQL parser - Phase 2
  3. MDEV-10590

sql_mode=ORACLE: Built-in package DBMS_OUTPUT

    XMLWordPrintable

Details

    • Technical task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • OTHER

    Description

      Implement a built-in package DBMS_OUTPUT for sql_mode=ORACLE.
      This feature is actively used by Oracle users, especially for debugging purposes.

      The idea:

      • A stored routine can send debug messages using DBMS_OUTPUT methods, such as DBMS_OUTPUT.PUT_LINE(), which are collected in the package internal buffers.
      • The client program e.g. SQL*Plus retrieves the collected messages using methods such as DBMS_OUTPUT.GET_LINE()

      SQL*Plus understands a special command SET SERVEROUTPUT ON; to enable displaying of the DBMS_OUTPUT messages after each statement executed.

      Example:

      DROP FUNCTION f1;
      CREATE FUNCTION f1 (a INT) RETURN INT
      AS
      BEGIN
        DBMS_OUTPUT.PUT_LINE('a IS '||TO_CHAR(a));
        RETURN a;
      END;
      /
      SET SERVEROUTPUT ON;
      SELECT f1(10) FROM DUAL;
      

          F1(10)
      ----------
      	10
       
      a IS 10
      

      Possible implementation using NOTEs

      When we have MDEV-10591 implemented, we will be able just to create a package DBMS_OUTOUT with a procedure PUT_LINE('string') which will just send 'string' to the client as a NOTE. That would not be exactly the same how Oracle works, but very close, and useful for debugging purposes.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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