Home > Mobile >  How to check if i have the rights to create functions?
How to check if i have the rights to create functions?

Time:01-08

So i'm trying to create a stored function but i keep getting this error:

Error report -
ORA-00604: error occurred at recursive SQL level 1
ORA-20900: No access to modify schema
ORA-06512: at line 3
00604. 00000 -  "error occurred at recursive SQL level %s"
*Cause:    An error occurred while processing a recursive SQL statement
           (a statement applying to internal dictionary tables).
*Action:   If the situation described in the next error on the stack
           can be corrected, do so; otherwise contact Oracle Support.

Fact is, 2-3 hours ago i created some functions and worked like a charm. I can't really understand what is happenning.

Code here (i don't know if this is relevant, as the function doesnt even go to compile)

CREATE OR REPLACE FUNCTION wsxsxfunct(x_data number)
    return ECHIPE.id_echipa%type IS
    y ECHIPE.id_echipa%type;
BEGIN
    SELECT ID_ECHIPA INTO y
    FROM ECHIPE E, PILOTI P, REZULTATE R, CURSE C
    WHERE P.ID_PILOT = R.ID_PILOT
    AND E.ID_ECHIPA = P.ECHIPA
    AND R.ID_CURSA = C.ID_CURSA
    AND EXTRACT(MONTH FROM C.DATA_CURSA) = x_data;
    RETURN y;
    EXCEPTION
        WHEN NO_DATA_FOUND
            THEN dbms_output.put_line('Nu a avut loc nicio cursa in luna ' || x_data);
            RAISE_APPLICATION_ERROR(-20000,
                'Nu exista angajati cu numele dat');
        WHEN TOO_MANY_ROWS
            THEN dbms_output.put_line('Au avut loc mai multe curse in luna ' || x_data);
            RAISE_APPLICATION_ERROR(-20001,
                        'Exista mai multi angajati cu numele dat');
        WHEN OTHERS
            THEN dbms_output.put_line('Trebuie sa apelezi functia cu un numar intre 1-12, reprezentand numarul lunii');
            RAISE_APPLICATION_ERROR(-20002,'Alta eroare!');
END;
/

Ignore those messages from the code. thanks

EDIT:

I tried old codes from the functions i created a few hours ago, and i'm still getting the same error report.

CodePudding user response:

ORA-20900 (and generally errors between 20000 and 20999) are 'custom' errors, namely, they come from a call to RAISE_APPLICATION_ERROR.

Thus this is not a (native) privileges issue. Most likely is that an administrator has created a DDL trigger which blocks your attempt to create a function (and potentially other objects).

Speak to your DBA.

  •  Tags:  
  • Related