Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Apex 应用程序,我需要根据登录的用户名显示数据。我已经创建了角色,但我只想根据患者显示数据。例如:一个病人想看到他的个人数据,而不是其他病人的所有数据,这可以用 PL/SQL 做吗?
您可以为此使用变量 APP_USER。它包含登录用户的用户名。如果页面是公开的,那么 APP_USER 的值将是“nobody”。例子:
SELECT <columns> FROM <table> WHERE username = :APP_USER;
请注意,对于敏感数据,您可能希望查看更强大的数据安全方式,例如 VPD。这也可以与顶点一起使用。Rgds 科恩