You can't do this. You'll need a "getter" function to return the value of a public variable or constant defined in a pacakge:
CREATE OR REPLACE PACKAGE Package1 IS
A_CONSTANT CONSTANT VARCHAR2(100) := 'Constant value a';
B_CONSTANT CONSTANT VARCHAR2(100) := 'Constant value b';
FUNCTION get_const(p_id NUMBER) RETURN VARCHAR2;
END Package1;
CREATE OR REPLACE PACKAGE BODY Package1 IS
FUNCTION get_const(p_id NUMBER) RETURN VARCHAR2
IS
BEGIN
IF p_id = 1 THEN
RETURN package1.a_constant;
ELSIF p_id = 2 THEN
RETURN package1.b_constant;
END IF;
RETURN NULL;
END;
END Package1;
SQL> select package1.a_constant from dual;
select package1.a_constant from dual
ORA-06553: PLS-221: 'A_CONSTANT' is not a procedure or is undefined
SQL> select package1.get_const(1) from dual;
PACKAGE1.GET_CONST(1)
--------------------------------------------------------------------------------
Constant value a
SQL>
EDIT: If you can't modify these packages, can you create new functions or packages? If you can, you can workaround the issue thusly:
CREATE OR REPLACE FUNCTION get_const(p_id NUMBER) RETURN VARCHAR2 IS
BEGIN
IF p_id = 1 THEN
RETURN package1.a_constant;
ELSIF p_id = 2 THEN
RETURN package1.b_constant;
END IF;
RETURN NULL;
END;
/
SQL> select get_const(1) from dual;
GET_CONST(1)
--------------------------------------------------------------------------------
Constant value a
SQL> select get_const(2) from dual;
GET_CONST(2)
--------------------------------------------------------------------------------
Constant value b
SQL>
You are allowed to reference public variables from other PL/SQL objects.
In response to your last comment, I've added some code to show how one might write a function to get different values from the package with a single function. If this won't do, I'm afraid you're up the proverbial creek.