我有表users
;有(id, first_name, last_name)
列。
我想显示last_name||','||first_name
并为登录用户返回id
。
我该如何实现?
提前感谢
这取决于您所谓的“ ID
”以及您在其中存储的内容。
基本上,您必须具有一列,其中包含连接到Apex应用程序的用户的username。假设它是表中的新列:
create table users
(id number,
first_name varchar2(20),
last_name varchar2(20),
--
username varchar2(20) --> this
);
然后您可以通过:APP_USER
引用为>>
。如果您知道这一点,则可以从select last_name ||', '|| first_name from users where username = :APP_USER;
:APP_USER
值是您在Apex右上角看到的用户名
users
表中获取所需的任何内容。