-- the following will not work but try it so that you understand why
-- you can not use a stored procedure in a WHERE clause
CREATE OR REPLACE VIEW airplanes_view AS
SELECT *
FROM airplanes
WHERE program_id = dbms_application_info.read_client_info(x);

-- wrap the stored procedure so that it presents itself as a function
CREATE OR REPLACE FUNCTION app_info_wrapper
RETURN VARCHAR2 IS
x VARCHAR2(64);
BEGINdbms_application_info.read_client_info(x);
RETURN x;
END app_info_wrapper;
/

-- now you can create the view
CREATE OR REPLACE VIEW airplanes_view AS
SELECT *
FROM airplanes
WHERE program_id = app_info_wrapper;

SELECT * FROM airplanes_view
WHERE rownum < 1001;

exec dbms_application_info.set_client_info('777');

SELECT * FROM airplanes_view
WHERE rownum < 1001;

READ_MODULE

Reads the values of the module and action
fields of the current session