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

Oracle Comp.: Sql-Error when referencing database/schema in "select package-function from dual"

Details

    Description

      CREATE OR REPLACE PACKAGE lic.mytools AS
        FUNCTION gettest(atext INT) RETURN INT;
      END;
       
      CREATE OR REPLACE PACKAGE BODY lic.mytools AS
        FUNCTION gettest(atext INT) RETURN INT AS
          nSalary DECIMAL(10,2);
        BEGIN
          RETURN 111;
        END;
      BEGIN
        -- This code is executed when the current session
        -- accesses any of the package routines for the first time
        -- log(0, 'Session ' || connection_id() || ' ' || current_user || ' started');
      END;
      

      use lic
       
      select mytools.gettest(123) from dual;
      --> 111
       
      select lic.mytools.gettest(123) from dual;
      --> SQL Error [1064] [42000]: (conn:16) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(123) from dual
      Query is : select lic.mytools.gettest(123) from dual
      

      We use to have util packages in a separate schema on oracle which could be called from any other schema. Shouldn't this also work analog here?

      Attachments

        Activity

          It's not about DUAL, simple select lic.mytools.gettest(123) produces the same error. I don't think that three-level name specification is supported at all, assigning to bar to clarify whether it should be.

          elenst Elena Stepanova added a comment - It's not about DUAL , simple select lic.mytools.gettest(123) produces the same error. I don't think that three-level name specification is supported at all, assigning to bar to clarify whether it should be.

          Elena is right, three-level name specification is not supported yet.
          This needs to be fixed.

          bar Alexander Barkov added a comment - Elena is right, three-level name specification is not supported yet. This needs to be fixed.

          People

            bar Alexander Barkov
            Estabillo Mebo
            Votes:
            2 Vote for this issue
            Watchers:
            5 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.