3

In Oracle SQL Developer, how do I create or update a procedure and have the schema name be a variable:

    define my_schema_name = 'schema_1';  


    CREATE OR REPLACE PROCEDURE my_schema_name.updateDBUSER(
         p_userid IN DBUSER.USER_ID%TYPE,
         p_username IN DBUSER.USERNAME%TYPE)
    IS
    BEGIN

      UPDATE DBUSER SET USERNAME = p_username where USER_ID = p_userid;

      COMMIT;

    END;
5
define my_schema_name = 'SCHEMA_1';

CREATE OR REPLACE PROCEDURE "&my_schema_name".updateDBUSER(
     p_userid IN DBUSER.USER_ID%TYPE,
     p_username IN DBUSER.USERNAME%TYPE)
IS
BEGIN

  UPDATE DBUSER SET USERNAME = p_username where USER_ID = p_userid;

  COMMIT;

END;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.