Reputation: 675
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
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
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