user2950439
user2950439

Reputation: 19

Referencing oracle apex APP_USER

I want to reference app_user in query (where username=(:APP_USER)) Now my query returns null values, I guess it's happening because my username col is varchar2. How to reference app_user in this situation?

Upvotes: 0

Views: 19429

Answers (3)

Uday Shankar
Uday Shankar

Reputation: 458

you can use below:

where username=v('APP_USER')

Edit1: for performance constraints, it is always recommended that you do it like this:

where username=(select v('APP_USER') from dual)

Upvotes: 2

Mehran Arefkhani
Mehran Arefkhani

Reputation: 11

apex make username uppercase try (where UPPER(username)=(:APP_USER))

Upvotes: 0

Rajat Mishra
Rajat Mishra

Reputation: 3770

:APP_USER value depends upon the authentication model set in your application. If application is running using database authentication then the value of the user is the same as the database pseudo column USER. If the application uses an authentication scheme that requires the user to authenticate, the value of APP_USER is set by the authentication scheme, usually to the user name used during authentication.

Reference : Oracle documentation

Upvotes: 0

Related Questions