Andrii Havrylyak
Andrii Havrylyak

Reputation: 675

Search ID by : APP_USER apex oracle

I have an authorization table. There's a Username, Login and Password I want. Also I have P1_item, I want to assign this variable Username, when I write a log in log everything works and when the APP_USER. does not work

CREATE TABLE test
(
name  varcahar2(10),
login varcahar2(10),
pass NUMBER(10)
);
INSERT INTO test
        VALUES ('Andrii', 'log', 111);



select name from test where login = '&APP_USER.'

select name from test where login = 'log'

Upvotes: 0

Views: 318

Answers (3)

mohamad subhi bouchi
mohamad subhi bouchi

Reputation: 190

you can use V function (more details), but it is not recommended in SQL:

select name from test where login = V('APP_USER');

or you can bind the variable:

select name from test where login = :APP_USER;

Upvotes: 0

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60262

Don't use &APP_USER. as this is a substitution string - instead, bind the variable directly using :APP_USER, e.g.

select name from test where login = :APP_USER

Upvotes: 1

mandmi
mandmi

Reputation: 69

There is no value "APP_USER" in the login column...

Upvotes: 0

Related Questions