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"

    XMLWordPrintable

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

          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.